Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a column with values from other column

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.

7 Replies
sunny_talwar

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?

swuehl
MVP
MVP

LOAD

     ColumnA,

     IF(ColumnA >0 , ColumnA) AS ColumnB

FROM YourSource;

Not applicable
Author

Is there any way I can use an expression and create this column/field in the Straight Table?

sunny_talwar

Sure, use this as your expression:

If([Column A] > 0, [Column A])

Anonymous
Not applicable
Author

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.

Not applicable
Author

Thanks Guys. Got it

sunny_talwar

Great, Close the thread in that case