Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar chart measure with sum() and aggr()

Hi everybody,

I have a bar chart that shows the expenses vs the date. For each date I have objects that have been made with different quantities (I mean, each year and each day of each month the number of produced items is different). To show this, I compute the price of each object (every object is made up  of different small objects with different quantities and so I have to use sum() and Aggr()) and then I need to multiply the price by the produced quantity (I mean that maybe in one day there have been 1000 produced objcets and 700 are of a type, 300 of a different type).

The problem with the chart is that editing the expression I can only get the sum of everything in the middle of the bar chart, or the prices of the objects multiplied by the total quantity and not each one multiplied by its quantity.

If I use total after the sum expression I get what I want, but when I multiply by the produced quantity I get the product of the measure by the total quantity, not the quantity of each product

How can I solve this?

Thanks a lot for your attention

Best regards

Nicolò Cogno

10 Replies
Not applicable
Author

I solved using this expression

Sum(total(Aggr(Sum([QUANTITYOFSMALLEROBJECTS]*[QUANTITYOFBIGGEROBJECTS])*Min(PRICEOFSMALLEROBJECTS), SMALLEROBJECTS,BIGGEROBJECTS,DATE)))*Count([FINALOBJECTS])


Hope this helps