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

Percentage of row total (expression)

Experts,

I have a question concerning the percentage of a row-total.

Dimensions used: Client {Client X, Client Y}, Type {Type 1, Type 2}

The table below is the one I am trying to build in Qlikview.

To get the % of the column (columns C and F), I am using the following expression:

=sum({$<Month={"<= $(=num(Month))"},Year={$(=only(Year))}>} Sales)

/

sum(Total <Client>{$<Maand={"<= $(=num(Month))"},Year={$(=only(Year))}>} Sales)

The problem is the % of the row (columns D and G). I am using the following expression but it does not give me the correct answer. The funny thing is, the sum of alle the % row's is always 100%, but the calculation (and the percentage itself) is never correct.

=sum(Sales)/RangeSum(First(TOTAL Sum(Sales),1,NoOfColumns()))

Could anyone help me please?

Thanks in advance!

1 Solution

Accepted Solutions
rubenmarin

Hi, following your columns C and F expression, for columns D and G can you try?:

=sum({$<Month={"<= $(=num(Month))"},Year={$(=only(Year))}>} Sales)

/

sum(Total <Type>{$<Maand={"<= $(=num(Month))"},Year={$(=only(Year))}>} Sales)

View solution in original post

2 Replies
rubenmarin

Hi, following your columns C and F expression, for columns D and G can you try?:

=sum({$<Month={"<= $(=num(Month))"},Year={$(=only(Year))}>} Sales)

/

sum(Total <Type>{$<Maand={"<= $(=num(Month))"},Year={$(=only(Year))}>} Sales)

Not applicable
Author

Awesome! Looks like it was too easy to be true

Thanks a lot!