Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Passing multiple values to a column for displaying another column

Hi

I have scenario

Need to show one column based on another column values,my main column is Year and hiding column is State

In state column enable option i have written year =1999 or year =2000 or year =1999 and 2000,

Here


How to pass two values to year column?

Please do the needful

Thiru

5 Replies
sunny_talwar

May be like this:

=year = 1999 or year 2000 or SubStringCount(Concat(DISTINCT year, '|'), 2000) = 1 and SubStringCount(Concat(DISTINCT year, '|'), 1999) = 1

Not applicable
Author

Hi Sunny,

It is not working because by default akll the values present in year filter so

always it will return 1

Is there any other way if you please let me know

Thiru

Kushal_Chawda

if you want to hide the state column for Year 1999 and 2000 then try below expression in enable Condition

=if(match(Year,'1999','2000'),0,1)

sunny_talwar

Would you be able to share a sample with your expected output? Would be much easier to help you that way

Not applicable
Author

Hi Sunny,

It's working fine now

The script is below.

in script:

Load * Inline

[CatID, Category ,state,year,value

0,Regular ,A,1999,20

1,Occasional ,B,2000,30

2,Permanent,C,2016,40];

Front end:

Took a straight table with CatID, Category ,state,year as dim and Value as expression.


Then wrote the below expression in the conditional box of state dim.


if(SubField(GetFieldSelections(year),',',1)='1999' or right(GetFieldSelections(year),4)='2000' or (SubField(GetFieldSelections(year),',',1)='1999' and  right(GetFieldSelections(year),4)='2000') ,1,0)


example.PNGexample1.PNG

example2.PNG

example3.PNG