Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I have a pivot table that I want to calculate a weighted avg subtotal for. Can someone please help?

I need to calculate a weighted subtotal for the Total column.

Calculation for Weight:

sum({$<Cov_Mth_Date={'12/31/2017'}>}TOTAL <Market,County_Name> TotalMM)/sum({$<Cov_Mth_Date={'12/31/2017'}>}TOTAL <Market> TotalMM)

Percent:

sum({$<Cov_Mth_Date={'12/31/2017'}>}TOTAL <Market,County_Name> TotalMM)/sum({$<Cov_Mth_Date={'12/31/2017'}>}TOTAL <Market> TotalMM)*([Bnchmrk])

Total:

Sum(Total<Market,County_Name>(aggr(sum({$<Cov_Mth_Date={'12/31/2017'}>}TOTAL <Market,County_Name> TotalMM)/sum({$<Cov_Mth_Date={'12/31/2017'}>}TOTAL <Market> TotalMM)*([Bnchmrk]),[Bnchmrk])))

I would like to be able to drop the Weight and Percent columns and just use the Total Column.  Market 1 total should be $873. Market 2 should be $861, or the sum of the percent column.  I know I'm close....

   

MarketCountyTotalMMBnchmrkWeightPercentTotal
1Market Total2239 100.00% $5,235
1A276$84612.33%$104$846
1B590$88126.35%$232$881
1C58$8912.59%$23$891
1D392$84317.51%$148$843
1E392$89117.51%$156$891
1F531$88323.72%$209$883
2Market Total2229 100.00% $2,574
2G454$86020.37%$175$860
2H1116$87450.07%$437$874
2I659$84029.56%$248

$840

11 Replies
Anonymous
Not applicable
Author

Brilliant!  Thanks it worked!

sunny_talwar

No problem at all... I am glad we were able to help....

Please close the thread by marking correct and helpful responses.

Best,

Sunny