Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
cantona_rules
Partner - Contributor II
Partner - Contributor II

Use of set-analysis and aggr in a if function

Hi.

If I use this expression it works:

=aggr(MaxString ({$<databasename_YEAR={'$(=getfieldselections(databasename))'}>} Indikatorname_YEAR),Indikatorname_YEAR)

But if I use it in a IF function it does not work:

=if(GetSelectedCount(databasename) = 1,aggr(MaxString ({$<databasename_YEAR={'$(=getfieldselections(databasename))'}>} Indikatorname_YEAR),Indikatorname_YEAR),
if (GetSelectedCount(databasename_YEAR) = 1,Indikatorname_YEAR))

 

And have also tried the above in a if-then-else but with the same result.

Can anyone tell me why it does'nt work in the if function 

 

 

 

Thanks

Labels (1)
1 Solution

Accepted Solutions
cantona_rules
Partner - Contributor II
Partner - Contributor II
Author

hmm ok I fixed it like this:

=aggr(MaxString ({$<databasename_YEAR={'$(=getfieldselections(databasename))', '$(=getfieldselections(databasename_YEAR))' }>} Indikatorname_YEAR),Indikatorname_YEAR)

 

but it still puzzle me why the if then did'nt work!

 

View solution in original post

1 Reply
cantona_rules
Partner - Contributor II
Partner - Contributor II
Author

hmm ok I fixed it like this:

=aggr(MaxString ({$<databasename_YEAR={'$(=getfieldselections(databasename))', '$(=getfieldselections(databasename_YEAR))' }>} Indikatorname_YEAR),Indikatorname_YEAR)

 

but it still puzzle me why the if then did'nt work!