Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a column with numerical values (Mostly 0 and 1). I need to create another column/field from the other column on a condition.
If the values in the Column A are > 0, then the Column B should contain those greater than values.
May be this:
LOAD [Column A],
If([Column A] > 0, [Column A]) as [Column B]
FROM ....
This will make column B only have values when it is greater than 0. When Column A is 0 or less than 0, Column B will be null.
Is this what you want?
LOAD
ColumnA,
IF(ColumnA >0 , ColumnA) AS ColumnB
FROM YourSource;
Is there any way I can use an expression and create this column/field in the Straight Table?
Sure, use this as your expression:
If([Column A] > 0, [Column A])
If(column(1) > 0, column(1))
where 1 is the number of expression column in your Straight Table or you can use the name of your expression
if(ExpresionName>1,ExpresionName)
Regards.
Thanks Guys. Got it
Great, Close the thread in that case