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

Max(Aggr()) facing problem

I am trying to find the max visits value from a trend chart for visits.

I am using the following expression :

=Max(Aggr(Sum({<Date={">=$(PrevMonth_2)<=$(=Date(Max(Date)))"}, Quarter=, [Ref]={'All'}>}Visits)/1000000,Date))

Here, PrevMonth_2 is a variable that points to the six months
prior to the current selected month i.e. start month of the trend.

Ref={‘All’} condition is used so that I get all the visits for ‘all’ the referrals.

Date is the variable that I have named for months.

The above expression returns me only the visits for the latest selected Month (variable Date) i.e. the last data point of the trend.

Kindly help me to resolve it. It is quite urgent.


Thanks

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

You should try something like this

=Max({<Date={">=$(PrevMonth_2)<=$(=Date(Max(Date)))"}, Quarter=, [Ref]={'All'}>} Aggr(Sum({<Date={">=$(PrevMonth_2)<=$(=Date(Max(Date)))"}, Quarter=, [Ref]={'All'}>}Visits)/1000000,Date))

View solution in original post

5 Replies
Not applicable
Author

Hi,

PFA  and modify your sample application expression or post you sample application

CELAMBARASAN
Partner - Champion
Partner - Champion

You should try something like this

=Max({<Date={">=$(PrevMonth_2)<=$(=Date(Max(Date)))"}, Quarter=, [Ref]={'All'}>} Aggr(Sum({<Date={">=$(PrevMonth_2)<=$(=Date(Max(Date)))"}, Quarter=, [Ref]={'All'}>}Visits)/1000000,Date))

Not applicable
Author

Thanks a lot. Its working fine now.

Not applicable
Author

Celambarasan Adhimulam Thanks for your solution. Can you please also explain me why the expression that was used by me was not correct?
I have used similar expression in other applicatoins and they are working fine.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

I don't know what you have done in other applications.

But here your excluding the selections in Sum which is inside aggr.

If you apply simply max function for around the Aggr then it will take the Maximum value for the selection alone.

You have to use the same set analysis outside the Aggr.