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: 
Not applicable

How to keep my variable fixed?

All to you all,

Once more I need your advice…

I’m calculating an average value using this:

sum(aggr(sum(ac+dc),A))/sum(aggr(sum(ac+dc+dnc+anc),A))

this is put into a variable.

Now when is start making my selections, this value, obviously, changes and I like to make it stick with my original calculation prior my selection.

I’m not calculating this in the load script.

Set analysis maybe? Or any other simple way?

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

If you don't want your calculation to depend on selections (if this is what you mean by 'original calculation') try this:

sum({1}aggr(sum({1}ac+dc),A))/sum({1}aggr(sum({1}ac+dc+dnc+anc),A))

View solution in original post

3 Replies
Not applicable
Author

Hi,

If you don't want your calculation to depend on selections (if this is what you mean by 'original calculation') try this:

sum({1}aggr(sum({1}ac+dc),A))/sum({1}aggr(sum({1}ac+dc+dnc+anc),A))

Not applicable
Author

does the trick, thanks a lot

CELAMBARASAN
Partner - Champion
Partner - Champion

Aggr only does on the possible values of the given dimension.

Try this I think it will also be same as yours(Check it.I hope so )

(Sum({1}ac)+Sum({1}dc))/(Sum({1}ac)+Sum({1}dc)+Sum({1}dnc)+Sum({1}anc))