Forum Discussion
Anonymous
7 years agoNot applicable
Convert wind degrees to direction
Hi everyone Can anyone help with how to convert wind degrees to direction. For example, I have the degrees like below but want the column on the right. Thanks in advance! Deg Dir 202 ...
- 7 years ago
Hi Anonymous
You don't describe the ranges for each Dir. I've just used 4 Dirs as an example to show the pattern you can use. You would just have to update/expand the conditions to what you need.
NewColumn = VAR _Deg = Table1[Deg] RETURN SWITCH(TRUE(), (_Deg >= 0 && _Deg< 90), "N", (_Deg >= 90 && _Deg< 180), "E", (_Deg >= 180 && _Deg< 270), "S", (_Deg >= 270 && _Deg< 360), "W" )
AlB
Community Champion
7 years agoHi Anonymous
You don't describe the ranges for each Dir. I've just used 4 Dirs as an example to show the pattern you can use. You would just have to update/expand the conditions to what you need.
NewColumn =
VAR _Deg = Table1[Deg]
RETURN
SWITCH(TRUE(),
(_Deg >= 0 && _Deg< 90), "N",
(_Deg >= 90 && _Deg< 180), "E",
(_Deg >= 180 && _Deg< 270), "S",
(_Deg >= 270 && _Deg< 360), "W"
)
kitrito
4 years agoNew Member
could you tell me, what is this programme? to insert in this code