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

Chart Expression

Hello,

           I have two expressions i.e. sum(sales) , gives the sales for each year for selected country

and second one is sum(TOTAL <Year> aggr( sum(sales),Year)), gives total sales for all the years for selected country, now am trying to  calculate the share from these expression means sum(sales)/sum(TOTAL <Year> aggr( sum(sales),Year)) but am not getting desired result just am getting 100% share all the years, how to calculate the expression from these expression?

4 Replies
miikkaqlick
Partner - Creator II
Partner - Creator II

Hi!

Like this:

Divide Column(1) by Column(2) and show result as percentage.

Br

Miikka

Climber

Not applicable
Author

Hi,

   Thanks for your replay, I have already tried with Column(1)/Column(2) but it doesn't work from me.

JonnyPoole
Employee
Employee

Usually the TOTAL syntax is used to subtotal the expression by chart dimensions... so dimensions that are included in the chart . Is it in your chart ?  If not, you could also try:


sum(sales)

/

aggr( sum(sales),Year)


or


sum(sales)

/

sum(aggr( sum(sales),Year))


or post a sample qvw for better guessing

MK_QSL
MVP
MVP

Use

SUM(Sales)/SUM(TOTAL <Year> Sales)