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

Expression Sum with a sum variable

Hi

I’m having problems with the below expression.

I have not made any selections in dimension other what is in this expression.

=sum({$<Calendar_YearAndMonth={'201401','201402','201403','201404'}>}$(vCO_POSIBLE_TURNOVER))

The varible “vCO_POSIBLE_TURNOVER” is 

(sum($(vCO_NET_AMOUNT_EUR))+(sum($(vCOINVO_NET_AMOUNT_EUR))))

And this variable works outside this expression.

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Michael,  Please use set Analysis also in the the variable :

LET vCO_POSIBLE_TURNOVER =

(sum({$<Calendar_YearAndMonth={'201401','201402','201403','201404'}>} $(vCO_NET_AMOUNT_EUR))+(sum({$<Calendar_YearAndMonth={'201401','201402','201403','201404'}>} $(vCOINVO_NET_AMOUNT_EUR))))

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

in your expresion instead of writeing

$(vCO_POSIBLE_TURNOVER))

write:

$(=$(vCO_POSIBLE_TURNOVER)) )

Not applicable
Author

Michale,

Sum of sum will not work.

Modify your valriable so that it becomes A+B and not sum(A)+sum(B)

Fabrice

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You cannot nest SUMs directly; use aggr() if necessary - something like this:

sum({$<Calendar_YearAndMonth={'201401','201402','201403','201404'}>} Aggr($(vCO_POSIBLE_TURNOVER), ChartDim1, ChartDim2, ...))

(where ChartDim1, ChartDim2 is a comma separated list of dimensions in your chart or table.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

I thank you all for your help…… I have tried them but they did not succeeded, so I will keep on trying new ways to get this solved.

Br

Michael

Not applicable
Author

Hi Michael,  Please use set Analysis also in the the variable :

LET vCO_POSIBLE_TURNOVER =

(sum({$<Calendar_YearAndMonth={'201401','201402','201403','201404'}>} $(vCO_NET_AMOUNT_EUR))+(sum({$<Calendar_YearAndMonth={'201401','201402','201403','201404'}>} $(vCOINVO_NET_AMOUNT_EUR))))

Not applicable
Author

Thank you dathu.... this one worked 🙂