Announcements
Sept. 27, 10AM ET Do more with Qlik, Insight Advisor – our intelligent AI-assistant in Qlik Sense: Register
cancel
Showing results for
Did you mean:
Contributor III

Set analysis syntax

Hi,

I do not yet get set analysis that well, so this might be a dumb question.

Is it possible to make a statement that you want a field to be in something, but still selectable?

Example:

Field: EventCode

I want it to always be within specific codes. Let say 450,455 & 550. If no user selection, I want to count all of the defined codes. But if the user select one of the eventcodes, I want only that one to be counted.

What my expression looks like now:

=Count(
{
<State={1},EventCode={450,455,550},Parameter={9}>
}EventTime
)

I have tried to add the \$

=Count(
{\$
<State={1},EventCode={450,455,550},Parameter={9}>
}EventTime
)

=Count(
{
<State={1},EventCode={\$450,455,550},Parameter={9}>
}EventTime
)

, but it did not change anything. I guess by saying "EventCode={450,455,550}", I'm actually telling it to always show the eventcodes no matter what.

So my question: Is it possible to dictate that the eventcode has to be within some values, but still make them selectable?

Labels (2)

• Set Analysis syntax

1 Solution

Accepted Solutions
MVP

Yes you can; using implicit set operator '*' like:

EventCode *={450,455,550}

3 Replies
Partner - Specialist

Hi,

try in this way:

=if(GetSelectedCount(EventCode)=0,Replace(' 455 ' & ',' & ' 450 ' & ',' & ' 550 ',' ',chr(39)),chr(39) & Concat(EventCode,chr(39) & ',' & chr(39)) & chr(39))

2) then use that variable inside set analysis

EventCode={\$(variable)}

MVP

Yes you can; using implicit set operator '*' like:

EventCode *={450,455,550}

Contributor III
Author

@tresesco wrote:

Yes you can; using implicit set operator '*' like:

EventCode *={450,455,550}

Yaaaassss. Great. Thank you 😁

Community Browser