Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Percentage subtotal

Hello,

I need to distribute 100% by each month and also by Brand, so the Brand should be the 100%.

First i tried with this formula wich is correct by month:  

sum (NUM_PAX_BKD_LB)/ sum (total <[Quarter Cruise]>(NUM_PAX_BKD_LB) )

And this is the result 

Quarter CruiseQ1Q1Q2Q2Q3Q3Q4Q4
BrandFare Type#%Month#%Month#%Month#%Month
Total 10.372100%15.627100%26.778100%7.662100%
xxxTotal5.80956%7.08145%12.59847%2.51233%
xxxGRP6046%2942%340%--
xxxHM460%4193%1.0324%4866%
xxxIND5.15950%6.36841%11.53243%2.02626%
YYYTotal4.56344%8.54655%14.18053%5.15067%
YYYGRP9129%1.1657%----
YYYHM160%220%2311%1121%
YYYIND3.63535%7.35947%13.94952%5.03866%

But what i need is also to fix the Brand and get a tablke like this one:

     Thanks!

Quarter CruiseQ1Q1Q2Q2Q3Q3Q4Q4
BrandFare Type#%Month#%Month#%Month#%Month
xxxTotal5.809100%7.081100%12.598100%2.512100%
xxxGRP60410%2944%340%--
xxxHM461%4196%1.0328%48619%
xxxIND5.15989%6.36890%11.53292%2.02681%
YYYTotal4.563100%8.546100%14.180100%5.150100%
YYYGRP91220%1.16514%----
YYYHM160%220%2312%1122%
YYYIND3.63580%7.35986%13.94998%5.038

98%

1 Solution

Accepted Solutions
MVP
MVP

Re: Percentage subtotal

sum (NUM_PAX_BKD_LB)/ sum (total <[Quarter Cruise], Brand>(NUM_PAX_BKD_LB) )


or


sum (NUM_PAX_BKD_LB)/ sum (total <[Quarter Cruise], Brand, [Fare Type]>(NUM_PAX_BKD_LB) )

2 Replies
MVP
MVP

Re: Percentage subtotal

sum (NUM_PAX_BKD_LB)/ sum (total <[Quarter Cruise], Brand>(NUM_PAX_BKD_LB) )


or


sum (NUM_PAX_BKD_LB)/ sum (total <[Quarter Cruise], Brand, [Fare Type]>(NUM_PAX_BKD_LB) )

Not applicable

Re: Percentage subtotal

Thanks!

Community Browser