Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum above values only when a dimension value is equal to the current one

Hi guys, I can't figure out how to sum above rows only when the rows have a field value equal to the current one.

Two dimensions: CAR and COLOR

Value QUANTITY

Let's see the source table:

source.png

I'd like sum for eache row above quantity + current quantity only when color equals to the current one.is what I expect to obtain.

2014-02-27-1141 -001.png

How can I obtain it with formulas ?

thank you

3 Replies
datanibbler
Champion
Champion

Hi martinovedana,

aggregate: Insert a sum([Quantity]) function in your LOAD.

=> Keep in mind you then need a GROUP BY clause encompassing ALL OTHER fields present in your LOAD.

HTH

Best regards,

DataNibbler

Anonymous
Not applicable
Author

thanks DataNibbler but I can't do it during LOAD because it has to be dynamic based on current selections

datanibbler
Champion
Champion


Hi,

well, on the GUI, you could use a set_expression to sum up all the items grouped by (the user's current selection) which you can query using GETFIELDSELECTIONS().