Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

issue with aggregation

Hi everyone,

I need to know for what Year the maximum number of  calls are received from Active type over the years in a textbox.(Excluded the year filter so i have put "Year=")

I am using the following expression.


=max(Aggr(Count({<TYPE={'Active'},Year=>} Call_ID ),Reason,Year)).


With this my result in 29813.


Individually for Year

2015 - 29813,

2014-32994,

2013- 27661,

2012 - 13343,

2011-7232

when i do the above expression the result should be 32994.

What is wrong with the expression??

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Nithin,

Try this:

=max({1<Year=>}Aggr(Count({1< COVERAGE_TYPE={'Active'}>}Call_Log_ID),CallReason,Year))

double check the syntax in the editor because I've not been able to.

Cheers

View solution in original post

9 Replies
sunny_talwar

May be you need a DISTINCT count?

=Max(Aggr(Count(DISTINCT{<TYPE={'Active'},Year=>} Call_ID ),Reason,Year)).

Not applicable
Author

Nope, didn't work.

I have selected 2015, But for some reason year filter  is not being Excluded.

sunny_talwar

Would you be able to share a sample?

Not applicable
Author

I can't share nothing more than this as data is confidential.

I need to retrieve the highest value of all the charts using an Aggr() in a textbox.

Selection.PNG

effinty2112
Master
Master

Hi,

Why do you need to aggregate on the field 'Reason'? If you take it out to leave

=max(Aggr(Count({<TYPE={'Active'},Year=>} Call_ID ),Year))

what is the answer then?

In 2014 if you have  29813 Active type call of reason A and 3181 for reason B (total 32994) your Aggr expression will return 29813.

Not applicable
Author

Hi Andrew,

Please refer to the above image. i need Highest number of calls for any reason over all the years. it is working fine if i don't select an year. but if i select an year it is limiting to the that Year.

That is the challenge am facing.

effinty2112
Master
Master

Hi Nithin,

Try this:

=max({1<Year=>}Aggr(Count({1< COVERAGE_TYPE={'Active'}>}Call_Log_ID),CallReason,Year))

double check the syntax in the editor because I've not been able to.

Cheers

Not applicable
Author

Thanks Andrew, It worked.

effinty2112
Master
Master

You're very welcome!