Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with expression please

Hi

I have this expression in a filter pane for a table in Qlik Sense Server:

= Aggr( If (Count({<[Client ID]=>} Product)=1,'1 Module','More than 1 Module'),[Client ID])

What I'm wanting to do is to add another condition - if the count < 1 then 'No Modules'.

So, in a nutshell:

<1: 'No Modules'

=1: '1 Module'

All else: 'More than 1 Module'

I can't work out how to incorporate that additional condition though - any assistance greatly appreciated thanks!

1 Solution

Accepted Solutions
PrashantSangle

why are you using aggr()? any specific reason..

use nested if, try below expression

Aggr(If (Count({<[Client ID]=>} Product)<1,'No Modules',If (Count({<[Client ID]=>} Product)=1,'1 Module','More than 1 Module')),[Client ID])


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

3 Replies
PrashantSangle

why are you using aggr()? any specific reason..

use nested if, try below expression

Aggr(If (Count({<[Client ID]=>} Product)<1,'No Modules',If (Count({<[Client ID]=>} Product)=1,'1 Module','More than 1 Module')),[Client ID])


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

It was an expression I found in a forum here, and just modified it for my use - so I have no idea really, sorry!

But thank you - your suggestion works perfectly.

PrashantSangle

if aggr() not required, then remove it. It consume unnecessary RAM.

below

If (Count({<[Client ID]=>} Product)<1,'No Modules',If (Count({<[Client ID]=>} Product)=1,'1 Module','More than 1 Module'))


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂