Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Condition to show a field

What is a condition I can use to show a field in a pivot table from a list box created by an inline load?

1 Solution

Accepted Solutions
simenkg
Specialist
Specialist

substringcount(Concat(InlineField,'|'),DimensionName)=1


Example:

%Dimensions:
Load * inline [

%Dimension

Year,

Month

];

the condition for showing dimension Year then becomes:

Substringcount(Concat(%Dimension,'|'),'Year')=1

View solution in original post

11 Replies
simenkg
Specialist
Specialist

substringcount(Concat(InlineField,'|'),DimensionName)=1


Example:

%Dimensions:
Load * inline [

%Dimension

Year,

Month

];

the condition for showing dimension Year then becomes:

Substringcount(Concat(%Dimension,'|'),'Year')=1

avinashelite

Hi,

Paste getselectedcount(filendname)>0 this in below suggested boxes

If your using it as dimension then below u will see Enable conditional write the condition here,

if your using it in expression use conditional it will do the job

Not applicable
Author

I'm having a weird issue. So I have fields like these in my inloads:

Source1

Source2

Source3

Source1_A

Source1_B

Source1_C

Source2_A

Source2_B

Source2_C

and so on.... the condition above works BUT if I select both Source1 and Source1_A, it will only show Source1_A. Same with the others. If I select all Source1, Source1_A, Source1_B, and Source1_C, it will show me everything except for Source1.

What is the issue here?

simenkg
Specialist
Specialist

This is because the substring "Source1" exists in Source1_A, Source1_B but not the other way around.

change your inline table to

%dimensions:

Load * inline [

%Dimension, %DimensionID

Source1, 01

Source2, 02

Source3, 03

Source1_A, 04

Source1_B, 05

Source1_C, 06

Source2_A, 07

Source2_B, 08

Source2_C, 09

];

and so on.

Then the condition becomes:

Substringcount(Concat(%DimensionID,'|'),'01')=1

but you still keep the %Dimension in the list box.

Not applicable
Author

Perfect! Thank you

Not applicable
Author

Is there any way that whenever I don't have any of them selected, that none of them show?

Right now, if I select one, it will only show that but if I have none selected, it will show all

simenkg
Specialist
Specialist

Yes.
Add:
Substringcount(Concat(%DimensionID,'|'),'01')=1 and GetSelectedCount(%Dimension)>0

Not applicable
Author

That doesn't seem to work... it doesn't show up at all...

simenkg
Specialist
Specialist

Have you changed "%Dimension" to the name of the Field you select in the list box?