Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression help

Hi guys Ive got an expresion related question.

I have this expresion:

if(GetSelectedCount(Registr)=0,12,GetSelectedCount(Registr))

want to say only getselected count of registr when the operator of it is 'AAA'. (operator='AAA')  How can I add that in this expresion, Im not getting my desired result. There can be more Registr selected, therefore it only has to do this for operator AAA.

I prefer set anlysis, but didnt get it to work.

Thanks!

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

=If(Count({<operator= {'AAA'}, Registr ={$(=GetFieldSelections(Registr, ','))} >} Registr ) = 0, 12,

Count({<operator= {'AAA'}, Registr ={$(=GetFieldSelections(Registr, ','))} >} Registr ))

Hope this helps you.

Regards,

Jagan.

View solution in original post

9 Replies
sunny_talwar

May be this:

if(GetSelectedCount(Registr)=0,12,Count(DISTINCT {<operator = {'AAA'}>}Registr))

alexandros17
Partner - Champion III
Partner - Champion III

If(Operator='AAA', if(GetSelectedCount(Registr)=0,12,GetSelectedCount(Registr)), 0)

let me know

Not applicable
Author

This doesnt work.

Not applicable
Author

This one works, only if I have operator AAA selected. But if I have another one selected too it doesnt work anymore.

It should still work then, but it should still only get the selected count where the registr belongs to operator AAA. Is this possible?

sunny_talwar

Try this:

If(WildMatch(GetFieldSelections(Operator), '*AAA*'), if(GetSelectedCount(Registr)=0,12,GetSelectedCount(Registr)), 0)

Not applicable
Author

so something like:

if(GetSelectedCount(Registr WHERE operator= 'AAA')=0,12,GetSelectedCount(Registr WHERE operator= 'AAA')), 0)


^this doesnt work of course.

Not applicable
Author

This doesnt work either. See my previous comment, it should behave like that. Can I?

jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

=If(Count({<operator= {'AAA'}, Registr ={$(=GetFieldSelections(Registr, ','))} >} Registr ) = 0, 12,

Count({<operator= {'AAA'}, Registr ={$(=GetFieldSelections(Registr, ','))} >} Registr ))

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Correct! Thank you very much, would never found that by myself!