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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
wnorwood
Contributor III
Contributor III

Ignore one value selection in field

Hello,

I am using set analysis so that I can apply controls around the selections users make.  Imagine that I have two filters [Ticket Type] and [Catalog HPE].  In this example, I want it to sum the TICKET_COUNT for [Ticket Type] = Incidents which is easy enough.  But, I also need it to ignore the Catalog HPE selection - but only when Service Request is selected.  If any other value (e.g. Access Control) is selected from HPE, the filter should apply like normal.

I found the following on Google.  It gives me the total for Ticket Type = Incidents when nothing is selected.  It gives me the Total Incidents where Catalog HPE = Access Control when I select it from the filter.  However, I get 0 when I choose Service Request from Catalog HPE.  I would expect it to ignore the selection and give me the same result as if no selection had been made.

({<[Ticket Type]={'Incidents'},[Catalog HPE] -= {'Service Request'}>} TICKET_COUNT)

Can anyone tell me what I am missing?

Thanks.

1 Solution

Accepted Solutions
sunny_talwar

May be this:

If(GetFieldSelections([Catalog HPE]) = 'Service Request', Count({<[Ticket Type]={'Incidents'}, [Catalog HPE] = {'*'} - {'Service Request'}>} TICKET_COUNT), Count({<[Ticket Type]={'Incidents'}, [Catalog HPE] = p([Catalog HPE])>} TICKET_COUNT))

View solution in original post

2 Replies
sunny_talwar

May be this:

If(GetFieldSelections([Catalog HPE]) = 'Service Request', Count({<[Ticket Type]={'Incidents'}, [Catalog HPE] = {'*'} - {'Service Request'}>} TICKET_COUNT), Count({<[Ticket Type]={'Incidents'}, [Catalog HPE] = p([Catalog HPE])>} TICKET_COUNT))

wnorwood
Contributor III
Contributor III
Author

THANK YOU!!!  I had actually started working on an IF statement after my post, but I was having trouble figuring it out.  The part I was missing was GetFieldSelections([Catalog HPE]) = 'Service Request'.  I was using [Catalog HPE] = 'Service Request' which I believe was checking each record for the value instead of the filter selection value.

Here is my final expression, in case you were interested:

(match(GetFieldSelections([Catalog HPE]),'Service Request','Incidents') ,
SUM({<[Ticket Type]=, [Catalog HPE]=>} TICKET_COUNT),
SUM({<[Ticket Type]=>} TICKET_COUNT))