Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Master II
Master II

Re: How to create a column derived from 2 existing columns

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

 

Attached Qvw

View solution in original post

4 Replies
Highlighted
Partner
Partner

Re: How to create a column derived from 2 existing columns

hi 

in your load script 

write something like this : 

load 

PriceA,

PriceB,

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

From XXXX

Highlighted
Master II
Master II

Re: How to create a column derived from 2 existing columns

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

 

Attached Qvw

View solution in original post

Highlighted
Contributor III
Contributor III

Re: How to create a column derived from 2 existing columns

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

Highlighted
Contributor III
Contributor III

Re: How to create a column derived from 2 existing columns

thanks...this works!