Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Have a requirement,need to create a field in the script wth 3 defined range so that if it's 1st range it Shud give 1 else 2 or 3 ,how to do that.
create an expression like
LOAD
*,
IF(MyCheckField < 100, 1, IF(MyCheckField < 1000, 2, 3)) AS Range
FROM ....;
Edith would like to add that a field with content 1, 2, 3 is not a binary field ...
Peter
can you give an example?
ok and also i would like to create this field as it doesnt exist in my script.
how to and where to do that.
Or without nested IF() calls:
LOAD ...
Match(-1, FieldToCheck<1000, FieldToCheck<2000, FieldToCheck>=2000) AS Flag,
...
The ranges can be made variable by defining two border variables and $-sign substituting them in the Match() call.
Best,
Peter
In Peter's example, the field is created in the script as Range.
You can't create fields outside of your load script.
You can however create a value column on the fly in an UI object by using the same expression without the AS Range part in a Calculated dimension or a simple expression column.