Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Zwax
New 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?

1 Solution

Accepted Solutions
MVP
MVP

Re: Set analysis syntax

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

 

EventCode *={450,455,550}

View solution in original post

3 Replies
Partner
Partner

Re: Set analysis syntax

Hi,

try in this way:

1) add a variable 

=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
MVP

Re: Set analysis syntax

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

 

EventCode *={450,455,550}

View solution in original post

Zwax
New Contributor III

Re: Set analysis syntax


@tresesco wrote:

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

 

EventCode *={450,455,550}


Yaaaassss. Great. Thank you 😁