Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
gizzel123
Creator
Creator

Need variables (for aggregate functions) used in charts according to the dimensions

I tried to add variable in place of expression, lets say for

Exp1=sum()  I created a variable ..with  vSum=Sum(field),

but the problem is ..the vsum is not according to the dimensions..it is coming as a total for the whole field.?

I need to do this because I want to add triggers using variables.

please help.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

In your load script, define vSum using Set, not Let:

Set vSum = Sum(Field);

Then in your expression, use

=$(vSum)

If that is still not respecting the dimensions, then its possible that the dimensions are not properly associated with [field] in your data model.

HTH

Jonathan

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

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

if you writ set vsum ...

and use your variable in the expression it will be computeddinamically according to the object you use

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

In your load script, define vSum using Set, not Let:

Set vSum = Sum(Field);

Then in your expression, use

=$(vSum)

If that is still not respecting the dimensions, then its possible that the dimensions are not properly associated with [field] in your data model.

HTH

Jonathan

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

Thanks Guys, it

worked