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: 
slacayo
Contributor III
Contributor III

Add a column in load statement based off criteria

I have a table that looks like this

LOAD * INLINE [
     ordernum,
     1,     
     -,      
     -,       
2,      3,      -,      4, ];

 It has distinct order numbers, I would like to make a column next to it that has 1 (if order number) and 0 (if not order number, in this case, if its a `-`) 

 

 How can I do this?

 

Labels (2)
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

LOAD *
,if(ordernum='-',0,1) as ordernum_flag
;
Load * INLINE [      ordernum,      1,      -,      -,
2,      3,      -,      4, ];

View solution in original post

1 Reply
stevejoyce
Specialist II
Specialist II

LOAD *
,if(ordernum='-',0,1) as ordernum_flag
;
Load * INLINE [      ordernum,      1,      -,      -,
2,      3,      -,      4, ];