Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nsm1234567
Creator II
Creator II

Aggr expression result changes based on enabling other expression

Hi There,

I'm having an issue with an expression that I'm hoping someone can assist with.  I'm working with a very old app within my company which has an unusual structure.  I tried to clean up the data model as much as possible, but I'm still getting an unusual result in one of my charts.  The user has requested a separate chart where one of the expressions is removed, however, removing the expression changes the value of the remaining expression in the chart.  I'm battling to figure out how to fix this.  I believe it has to do with the ordering returned by the aggr, but I have no idea how to make this consistent when the expression is enabled or disabled.  Does anyone have any ideas?

Both expressions enabled:

BothExpressions.png

One of the expressions disabled (value of Mvmnt Sales changes)

OneExpressions.png

Message was edited by: Nathan S removed security

1 Solution

Accepted Solutions
sunny_talwar

Try this

sum(if([Fin Year Month Link]>=vMIN_FIN_YEAR_MONTH_SELECT and [Fin Year Month Link]<=vMAX_FIN_YEAR_MONTH_SELECT and

aggr(max(TOTAL <[Branch No SK], [Fin Year Month Link]>[Day Date No SK]),[Branch No SK], [Fin Year Month Link], [Day Date No SK]) = [Day Date No SK],[Mvmnt Phys Sales Amount]))

View solution in original post

6 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Nathan,

the qvw seems to be locked using section access. What is the user name and password?

Marcus

qliksus
Specialist II
Specialist II

Please provide the section acess user name or password to open the App

nsm1234567
Creator II
Creator II
Author

Sorry about that, I've uploaded a new file with the security removed

nsm1234567
Creator II
Creator II
Author

Sorry about that, I've uploaded a new file with the security removed

sunny_talwar

Try this

sum(if([Fin Year Month Link]>=vMIN_FIN_YEAR_MONTH_SELECT and [Fin Year Month Link]<=vMAX_FIN_YEAR_MONTH_SELECT and

aggr(max(TOTAL <[Branch No SK], [Fin Year Month Link]>[Day Date No SK]),[Branch No SK], [Fin Year Month Link], [Day Date No SK]) = [Day Date No SK],[Mvmnt Phys Sales Amount]))

nsm1234567
Creator II
Creator II
Author

Hey there,

Thanks for this, it seems to work quite well.  I had come to a similar solution but was concerned that it wasn't "balancing" to the old results, but it seems that the app has always been incorrect.  I'm still not 100% sure why the aggregation of one expression impacts the aggregation of another expression though.  Seems a little strange