Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional expression issue

Hi All,

In my qv application I have created a straight table as the attached sample. The conditional expression that I have used for individual month field is  For example jan =SubStringCount(GetFieldSelections(Month,',',100),'Jan')>0 and GetFieldSelections(Quarter) <> 'Q2'

and GetFieldSelections(Quarter) <> 'Q3' and GetFieldSelections(Quarter) <> 'Q4'

pic1.png

But when I select any combination of quarter like Q2 and Q3, the output is like All the months are displayed with Q1 and Q4 months with 0 and Q2 , Q3 months with data. The output is correct but I don’t want Q1, Q4 to be displayed, since we are selecting only Q2 and Q3. This is for all possible Quarter combination.

pic2.png

Kindly provide a solution.

Regards,

Gerard

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Gerard,

I think the problem is that GetFieldSelections(Quarter) returns all selected Quarters, so your comparisons to won't work.

You could get around this using

=SubStringCount(GetFieldSelections(Month,',',100),'Jan')>0 and wildmatch(GetFieldSelections(Quarter),'*Q1*')

or even a bit shorter:

=count({<Month *= {'Jan'}>} Month)

View solution in original post

2 Replies
swuehl
MVP
MVP

Gerard,

I think the problem is that GetFieldSelections(Quarter) returns all selected Quarters, so your comparisons to won't work.

You could get around this using

=SubStringCount(GetFieldSelections(Month,',',100),'Jan')>0 and wildmatch(GetFieldSelections(Quarter),'*Q1*')

or even a bit shorter:

=count({<Month *= {'Jan'}>} Month)

Not applicable
Author

Thanks.... Its working.

Regards,

Gerard