Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

adding 2 different calculations to expression

Hi

I need to do the following...

I have a LIST BOX which displays various DEAL DESCRIPTIONS. Linked to these DEAL DESCRIPTIONS are Sales quantities.

I have created an expression which divides the Sales quantities by 3 when a specific DEAL DESCRIPTION is selected.

This is my expression

If ([Deal Description] = '900000 - P5-P8 MEAL DEAL £3' ,Sum(SalesQuantity))/3

But i need to divide any other DEAL DESCRIPTION by 2.

The reason for this is that the above DEAL DESCRIPTION incorportaes 3 products. But all other DEAL DESCRIPTIONS only incorporates 2 products,

Does anyone know how i would include this in my expression?

Thanks

1 Solution

Accepted Solutions
shumailh
Creator III
Creator III

dude copy the exactly same code which i posted earlier. ok

Regards,
Shumail

View solution in original post

3 Replies
shumailh
Creator III
Creator III

Use the else condition simple


If ([Deal Description] = '900000 - P5-P8 MEAL DEAL £3' ,Sum(SalesQuantity)/3, Sum(SalesQuantity)/2)


Regards,
Shumail Hussain

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks for your reply, But where would i use the ELSE condition.

I have tried copying exactly whats in your example, and tried putting else before the second sum, but it doesn't work??

shumailh
Creator III
Creator III

dude copy the exactly same code which i posted earlier. ok

Regards,
Shumail