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: 
Not applicable

Joining two different formulas in same expression

I am trying to join two different sets of formulas which work individually into one single measure(expression)

eg: expr1: Sum({<column1 ={'value1','value2'}>}Toal_Sales)

expr2: Sum({<column2 ={'value3','value4'}>}Sales_Amount)

I tried adding + and AND in between : Sum({<column1 ={'value1','value2'}>}Toal_Sales) + Sum({<column2 ={'value3','value4'}>}Sales_Amount) but this does not seem to help.

Thank you.

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

can you post your sample QVW ? 

I did a quick test with some sample data below and your original approach doesn't look incorrect

Untitled.png

View solution in original post

4 Replies
JonnyPoole
Former Employee
Former Employee

Is this the logic you are after ?

sum ( if ( (column1=value1 or column1=value2)  , Toal_Sales,0) + if(column2=value3 or column3=value4, Sales_Amount,0 )   )

Not applicable
Author


Sorry but when I looked at my values closely , it is not considering the values under second if statement

JonnyPoole
Former Employee
Former Employee

can you post your sample QVW ? 

I did a quick test with some sample data below and your original approach doesn't look incorrect

Untitled.png

Not applicable
Author

Yes you are right, it did work for me this time. Thanks again!!!