Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
LucasS
Partner - Contributor
Partner - Contributor

Sum with (dynamic) set expression returns "-" when more than one ID is selected

Hi Community! 

I have this unexpected behavior when evaluating a load script expression in table. 

I've generated the expression in the load script and then stored it in a variable which I call in the table like so: 
(I've done this because the "Set Expression Here" changes for each ID).

1.

Load
sum(aggr(sum({1<"Set Expression Here">}Value),Value)) as Expression,
ID;

2.

vAppCalculate: =Expression

3.

And then in my table I add $(vAppCalculate) as a measure. 

 


This works whenever I select 1 ID. When one ID is selected $(vAppCalculate) returns 0, because the set expression isn't fulfilled. If I fulfill the expression  $(vAppCalculate) correctly returns the Value. 

However as soon as I enable all ID's then $(vAppCalculate)  returns "-" for all ID's instead of the expected 0 even when the set expression is fulfilled. 


Thanks in advance!

- Lucas

Labels (2)
4 Replies
vinieme12
Champion III
Champion III

You cannot have a different formula for each row in your table

Expressions are evaluated only once per chart and not once per row,

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
anat
Master
Master

same logic can u define in front end object.

sum(aggr(sum({1<"Set Expression Here">}Value),Value))

LucasS
Partner - Contributor
Partner - Contributor
Author

Yes, but unfortunetly this doesn't work. The expression is not evaluated probably if done like that unfortunately. 

LucasS
Partner - Contributor
Partner - Contributor
Author

Okay, in that case it seems impossible to achieve.