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

Aggregation averages/group formula help

CalYrDIMProduct Sales MBF $/MBFProdGroupPercent of Whole
20142"KD DIM & STUDS $ 24,368,839.63     65,921.29 $ 369.67 A=MBF/sum(MBF)
20142"KD LOW GRADE $   1,447,809.60       6,216.19 $ 232.91 A
2014MISC $   2,186,794.56       7,481.65 $ 292.29 A
20143",4"ON GRADE GRN/HT $ 10,300,364.62     24,375.85 $ 422.56 B
20141"GRN-DF MRR $      968,450.32       4,665.39 $ 207.58 C
20142"GRN ALL GRADES $      519,565.14       1,624.49 $ 319.83 C
2014 DEBIT/CREDIT $    (152,184.18)           98.40 C

I am looking for an average function where    in excel it would be like above

my Qlik formula MBF/sum({$<CalYr={2014} >} MBF)   is giving me 100% - I know why but have brain freeze to get right

I also am looking for one

if in Prod Group A  - I want the Percentage makeup -   sum({$<CalYr={yr},ProdGroup={A} > MBF)/sum({$<CalYr={yr} > }MBF)

5 Replies
stabben23
Partner - Master
Partner - Master

Hi Cam,

You need something like this in Your Expression sum(MBF)/sum( total <ProdGroup>MBF)

Not applicable
Author

What happens when you get a change in Yr - I realize my example only had 1 year, what happens with Multiple Years?

sunny_talwar

May be just this?

Sum(MBF)/Sum(TOTAL <ProdGroup, Yr> MBF)

Not applicable
Author

That is probably too easy but probably correct

sunny_talwar

I guess the only way to know it would be to test it out