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

Sum IF with expressions

I have a chart (straight table) that displays:

Source (Dimension)

Product (Dimension)

ListPrice (Expression - this is a value from a table)

Volume (Expression)

ASP (Expression - this is a calculation [Revenue]/[Volume])

There can be many rows of data returned, but there is a ListPrice for all combinations of Sources and Products.

I want to add a columns that are expressions that will show the volume for all records where the ASP is less than the ListPrice (or above ListPrice).

I've tried these but they don't work, the sum of the two columns is less than the total volume shown.

sum(if(Revenue/Volume<ListPrice,Volume))

sum(if(Revenue/Volume>=ListPrice,Volume))


This seems like a simple problem, but I cannot figure out how to create an expression that will show the value I am trying to display.

1 Solution

Accepted Solutions
kkkumar82
Specialist III
Specialist III

Hi Tom,

I am not sure why my expression is not working but I tried with your kind of expressions.

Created a field Revenue/volume ​as avg.

Please find attached.

Hope it may help you.

Kiran Kumar

View solution in original post

2 Replies
kkkumar82
Specialist III
Specialist III

Hi,

Can you have try like this

sum({<ListPrice={">(Revenue/Volume"}>}Volume))

Thanks

Kiran Kumar

kkkumar82
Specialist III
Specialist III

Hi Tom,

I am not sure why my expression is not working but I tried with your kind of expressions.

Created a field Revenue/volume ​as avg.

Please find attached.

Hope it may help you.

Kiran Kumar