Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
john_henry
Contributor III
Contributor III

How to create a column derived from 2 existing columns

I need to create a column/dimension that is derived from values in 2 other columns. 

Derived Column logic:  if Price A is $0 or NULL, use Price B, else Price A

Price A

Price B

Derived Column
$0$100$100
 $200$200
$300$400$300
$500$0$500
$600 $600
1 Solution

Accepted Solutions
Siva_Sankar
Master II
Master II

Try: IF([Price A]='$0' or [Price A]='',[Price B],[Price A])

 

Attached Qvw

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

hi 

in your load script 

write something like this : 

load 

PriceA,

PriceB,

if(PriceA>0,PriceA,PriceB) as Price

From XXXX

Siva_Sankar
Master II
Master II

Try: IF([Price A]='$0' or [Price A]='',[Price B],[Price A])

 

Attached Qvw

john_henry
Contributor III
Contributor III
Author

Thanks for the suggestion...I'll use it if I need to create a column from the load script.

john_henry
Contributor III
Contributor III
Author

thanks...this works!