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

SUM formula in a chart (Measures)

Hello, I hope I can get some help...

I have a measure in a chart (not script/coding) I want to calculate  the sum of qty ordered units but cannot get the formula correct..

Using "sum(qty_ordered)" takes the full right column below to a sum of 13 but I only want it to calculate the sum of the item_type = 1.

Below I have an example of one (1) order which consist of several orderlines but its only the main product (in this case product "e" which shall be calculated as qty ordered).

Is there a formula to make this happen so the data only calculates the main product even though the full order consist of several other equipment (in a Measures chart)? I have tried IF and other formulas without a success..

Best regards

peter

    

Product/equipmentPriceItem typeQty orderedorder line no
a50311
b110312
c250213
d25214
e2500115
f10316
g75317
h375218
i500319
j403110
k13111
l1004112
m305113
5 Replies
aarkay29
Specialist
Specialist

sum({<[Item type]={'1'}>}Qtyordered)

Colin-Albert

You can do this using Set Analysis

     sum({<item_type ={1}>} qty_ordered)

albertovarela
Partner - Specialist
Partner - Specialist

Check out these 2 videos with Set analysis basics...

https://community.qlik.com/docs/DOC-8039

https://community.qlik.com/docs/DOC-8174

tigra999
Contributor III
Contributor III
Author

Great help Gents!!! working fine. 🙂

avinashelite

Try this

sum({<[Item type]={1}>}Qtyordered)


check this documents too