Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Expression help for Conditional Show/Hide

Hi,

I have two charts superimposed and at any time I need to show only one of them.

The condition determining which one should appear is determined by column Company having only 3 values A, B and C.

I have a list box that is used to filter on one or more values among the three.

When nothing is selected or when C is selected Chart 1 shows

Expression:

if(Company = 'A' OR Company = 'B'  OR (Company = 'A' AND Company = 'B'),0,1)

Alternatively I have also tried this

if(Company = 'A' OR Company = 'B' ,0,

if(Company = 'C',1 ))

When A or B or Both A and B are selected Chart 2 should show

if(Company = 'A' OR Company = 'B',1 ,

if(Company = 'A' AND Company = 'B' ,1,0 ))

Now when I select either A or B Chart 2 shows up but when I select both A and B, chart 1 shows up.

What am I doing wrong?

Any help would be highly appreciated.

Thanks,

AM

1 Solution

Accepted Solutions

Re: Expression help for Conditional Show/Hide

HI

=if(match(GetFieldSelections(Company),'A','B','A, B'),1,0)

Hope it helps

5 Replies

Re: Expression help for Conditional Show/Hide

HI

=if(match(GetFieldSelections(Company),'A','B','A, B'),1,0)

Hope it helps

Not applicable

Re: Expression help for Conditional Show/Hide

When you have only one Company selected Company will equal the selection, but if you have both selected, it will yield a null value.  Instead use Match() on GetFieldSelection(). Does that make sense?

Not applicable

Re: Expression help for Conditional Show/Hide

Thanks Mayil and Rebecca. It worked.

Not applicable

Re: Expression help for Conditional Show/Hide

Hi,

I am having a similar issue. I want to a chart to display only if a single value within a specific column has been selected. I would have thought that the following should work:

=IF(COUNT(DISTINCT(ProcessStage))=1,1,0)

If I put this into a text box it does display 0 when it shouldn't be visible and 1 when it should be. However when I put it into the "show conditional" field of the graph it no longer works.

Any ideas anyone?

Not applicable

Re: Expression help for Conditional Show/Hide

Daniel - for your issue it sounds like it would be better to use If(GetSelectedCount(FieldName)=1,1,0) for your conditional field. 

Community Browser