Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if statement using expressions

Hi all,

My problem is that I can't make my  IF statement to work.

Model of my problem:

My data:

House typePrice1Price2
A1000
A3000
B7000
B8000

Want to get pivot table:

House typePrice
A4000
B15000

Price is expression:  if([House type]=('A'), $(eSumPrice1), $(eSumPrice2))

My expressions:

eSumPrice1=Sum(Price1)

eSumPrice2=Sum(Price2)

It must be so simple, pls help me ASAP!

Tiv0li

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

=RangeSum(Sum(Price1),Sum(Price2))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
jeffmartins
Partner - Creator II
Partner - Creator II

Hi tiv0li321,

I tried to use your expression and it works for me. Maybe you didn't create the variables eSumPrice1 and eSumPrice2.

See the attached file.

Regards

Gysbert_Wassenaar

In your case you don't need if statements. Just use sum(numsum(Price1,Price2)) instead.


talk is cheap, supply exceeds demand
MayilVahanan

Hi

Try like this

=RangeSum(Sum(Price1),Sum(Price2))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.