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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

% cell of expression total of a row

Hi guys,

My title is not the not very clear, I know, but I did not know how to put it into words.

What I have got so far is a simple Pivot Table with

*dimension ARTICLE (ART1, ART2, ART3)

*dimension MONTH (JAN, FEB, MARCH)

*expression: sum({$<Month={"<= $(=num(Month))"}>} Sales) + sum({$<Month={"<= $(=num(Month))"}>} Returns)

In Excel this looks like:

ARTICLEJANFEBMARCH
ART1562
ART2134
AER3112

What I need is the following:

I need to show the contribution of each month to the total sales of an article (so basically the % of the row total).

ARTICLEJAN%FEB%MARCH%TOTAL
ART1538%646%215%13
ART2113%338%450%8
AER3125%125%250%4

Every year I will select the current month and it should show the months before that one plus the month itself (see expression) AND the percentage of those months.

Can anyone help me out please?

Thanks a lot!

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Divide the same expression with TOTAL option

=(sum({$<Month={"<= $(=num(Month))"}>} Sales) + sum({$<Month={"<= $(=num(Month))"}>} Returns)) /

(sum(TOTAL <ARTICLE>{$<Month={"<= $(=num(Month))"}>} Sales) + sum(TOTAL <ARTICLE>{$<Month={"<= $(=num(Month))"}>} Returns))


Regards,

Jagan.

View solution in original post

3 Replies
MK_QSL
MVP
MVP

Try

sum({$<Month={"<= $(=num(Month))"}>} Sales) + sum({$<Month={"<= $(=num(Month))"}>} Returns)/

(sum(TOTAL <ARTICLE>{$<Month={"<= $(=num(Month))"}>} Sales) + sum(TOTAL <ARTICLE>{$<Month={"<= $(=num(Month))"}>} Returns))


Update: Missed () ...


Thanks Jagan

jagan
Partner - Champion III
Partner - Champion III

Hi,

Divide the same expression with TOTAL option

=(sum({$<Month={"<= $(=num(Month))"}>} Sales) + sum({$<Month={"<= $(=num(Month))"}>} Returns)) /

(sum(TOTAL <ARTICLE>{$<Month={"<= $(=num(Month))"}>} Sales) + sum(TOTAL <ARTICLE>{$<Month={"<= $(=num(Month))"}>} Returns))


Regards,

Jagan.

Not applicable
Author

That's the one! Thanks a bunch !!