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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Setanalysis with getfieldselection field issues

I need help to understand what is going wrong with my syntax of getfield used in conjunction with set analysis

I am trying count the number of tickets when the user selects the field in the list box  titled 'Ticket Type'. I have used the below syntax but it shows an error in the set modifier when i type the below. I am not able to understand what is going wrong with it Can somebody please help me?

count(distinct {<Ticket_Type = {=getfieldselection(Ticket_Type)}Incident>})

Labels (1)
20 Replies
Anonymous
Not applicable
Author

Attaching the screenshot of the syntax. values appear blank. though it states that the expression is ok..normally the formulas should appear in blue but is not the case.

sunny_talwar
MVP
MVP

I have no idea why you need GetFieldSelections here? Can you elaborate the requirement a little more?

tresB
Champion III
Champion III

There are few bracket issues. Try to copy the expression suggested above and try.

tresB
Champion III
Champion III

Perhaps, he wants the output on selection only. I.e. - no result until any selection is there.

t_chetirbok
Creator III
Creator III

I think it should be $ not &

count(distinct {<Ticket_Type = {"&(=getfieldselections(Ticket_Type))"}>} Incident)


count(distinct {<Ticket_Type = {"$(=getfieldselections(Ticket_Type))"}>} Incident)

tresB
Champion III
Champion III

. Thanks.

sunny_talwar
MVP
MVP

In that case, what about this approach that Stefan mentioned?

=If(GetSelectedCount(TicketType) = 1, Count(DISTINCT Incident))

or

=If(GetSelectedCount(TicketType) >= 1, Count(DISTINCT Incident))

or

Count(DISTINCT Incident) * RangeMin(Alt(GetSelectedCount(TicketType), 1), 1)

Anonymous
Not applicable
Author

It worked the second time when i pasted it. Thanks for the explanation. I learnt something new.

Anonymous
Not applicable
Author

Thanks for the syntax.. It worked.

Anonymous
Not applicable
Author

It worked with the $ syntax as count(distinct {<Ticket_Type = {"$(=getfieldselections(Ticket_Type))"}>} [Incident])