Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditionally show the column based on two values

Hi

I created  a straight table in that i have few coulumns,want to disaply a coluimn based on another column two values

I have done getfieldselections(COUNTRY)=INDIA ,Its working but i want to give one more value

like getfieldselections(COUNTRY)=INDIA and getfieldselections(COUNTRY)=US

its not working for me it is working for only one value.

Please suggest for this

17 Replies
Not applicable
Author

Its working for India or US  and

i need third scenario like INDIA and US.

Means 1.India

           2.US

           3.INDIA and US

for third scenario waht i need to do?

Please do the needful

sunny_talwar

Are you using this in the script?

Not applicable
Author

Hi Thiru,

Try the below code n c if its working...


In the below example put your column name and modify as per your requirement

=if(SubField(GetFieldSelections(month_name),',',1)='Feb 2012' and  right(GetFieldSelections(month_name),8)='Mar 2012' ,1,0)

First select two values from a Country column and then take a text box and type

=GetFieldSelections(Country)..then you can c how your value is coming like in case of below example its coming like

Feb 2012, Mar 2012  for GetFieldSelections(month_name)...


So in your case if value is coming as : INDIA, US for GetFieldSelections(Country) then try below in your conditional box of expression:


=if(SubField(GetFieldSelections(Country),',',1)='INDIA' and  right(GetFieldSelections(Country),2)='US' ,1,0)


Thanks,

Itishree

Not applicable
Author

please give the solution for this scenario

i want to show conditional visibility in state column based on year column values

1.1999

2.2000

3.1999 and 2000

it is working for 1999 or 2000 not for both

year=1999 or year=2000 or(year=1999 and year =2000),but it is not working''

cab you please do the needful

Thiru

Not applicable
Author

please give the solution for this scenario

i want to show conditional visibility in state column based on year column values

1.1999

2.2000

3.1999 and 2000

it is working for 1999 or 2000 not for both

year=1999 or year=2000 or(year=1999 and year =2000),but it is not working''

cab you please do the needful

Not applicable
Author

Hi Thiru,

I tried with a simple example like below and it is working fine.

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

Thanks,

Itishree

Not applicable
Author

Hi Priyadharsini,

Yes true.

Its working fine.

Thnak you  so much.

Best regards

Thiru

Not applicable
Author

Hi Priya dharsini,

Sorry to say again it's not working.

I want show the column hide and visible based on the selection of year and associative values of year.

You are hiding the rows not complete column

Please do the needful

Thanks

Thiru