Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Not applicable

Calculating Market Share

I have below table in market share I want total of Year. its working fine but value is showing in 1st row of every year.

I have used aggr function =aggr(sum(Sale),Year).

I want to show total of 2012 of every row of 2012 and total of 2013 in every row of 2013 and so on.

Thanks,

Maksood Alam

1 Solution

Accepted Solutions
Partner
Partner

Re: Calculating Market Share

sum(Total <Year> Sale)

4 Replies
Partner
Partner

Re: Calculating Market Share

sum(Total <Year> Sale)

Not applicable

Re: Calculating Market Share

Thanks Simen

Partner
Partner

Re: Calculating Market Share

No problem

The thing you actually asked about is the reason why your expression only gives you the value in the first row. This is because the Aggr function is distinct by default, meaning it will only populate one of the lines. So to specifically answer your question, you can use the function =aggr(NODISTINCT sum(Sale),Year).

However, the reason I replied with the above expression is because its performance is much better and in this case will yield the right answer.

Regards

SKG

Not applicable

Re: Calculating Market Share

Cool..

I got your point. Thank you very much Simen for explaining this point. It's really very helpful.