Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, i think im going crazy, truly.
Im just trying to evaluate a column that has numbers and text. The text values are evaluated as 'NO_NUM' but the number values are clasified in some ranges. This is what i have right now:
if(IsNum(VAR),
if(num#(VAR,'#.#')<2.0,'RANGE1',
if(num#(VAR,'#.#')<3.0,'RANGE2','RANGE3'))
,'NO_NUM')
This doesnt work, every comparision i do i with the numbers for example x >5 returns true eventhough x is 2.
I just dont know what else to do, also have tried multiplying the numbers by 1 or adding 0 and for some reason a number like 0.6 is changed to 6.
Hope you can help me out.
Expected output:
VAR | OUTPUT |
---|---|
0.0 | RANGE1 |
1.5 | RANGE1 |
3.0 | RANGE3 |
PA | NO_NUM |
4.0 | RANGE3 |
2.0 | RANGE2 |
2.5 | RANG2 |
NP | NO_NUM |
Edited by: Rubiel Velasquez
This seems to work for me
Table:
LOAD *,
If(IsText(VAR), 'NO_NUM',
If(VAR < 2, 'RANGE1',
If(VAR < 3, 'RANGE2', 'RANGE3'))) as OUTPUT;
LOAD * INLINE [
VAR
0.0
1.5
3.0
PA
4.0
2.0
2.5
NP
];
Would you be able to share few rows of data with the output you expect to see from it?
Just added few rows as example in the original post. Thanks
This seems to work for me
Table:
LOAD *,
If(IsText(VAR), 'NO_NUM',
If(VAR < 2, 'RANGE1',
If(VAR < 3, 'RANGE2', 'RANGE3'))) as OUTPUT;
LOAD * INLINE [
VAR
0.0
1.5
3.0
PA
4.0
2.0
2.5
NP
];
I swear i've tried that before trying to use the num# fuction. It totally worked! Thanks so much