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

like operation

Hi Qlikview community

how can I analyze a selection at the selection set for specific sequence of letters? As an example, please see screenshot:

Scenario 1: 100 is selected.
--> 3 values are determined. Has any one string the letter 'a' , so in the output text is displayed: Letter found 'a'!

Scenario 2: 500 is selected:
--> the possible selection (Essen) Has no letter 'a'. In this case, is to be displayed the letter 'a' does not exist!

1 Solution

Accepted Solutions
matt_crowther
Specialist
Specialist

This seems to work for me:

=if(index(concat(City),'a')>=1,'Present','Not Present')

Where 'City' is the field / dimension you're looking across. Switch 'a' for a variable and it becomes even more flexible, also the above is case sensitive so stick an upper() function round both elements to make non-case sensitive and of course an isnull() function could also be used.

Hope that helps,

Matt - Visual Analytics Ltd

View solution in original post

4 Replies
matt_crowther
Specialist
Specialist

This seems to work for me:

=if(index(concat(City),'a')>=1,'Present','Not Present')

Where 'City' is the field / dimension you're looking across. Switch 'a' for a variable and it becomes even more flexible, also the above is case sensitive so stick an upper() function round both elements to make non-case sensitive and of course an isnull() function could also be used.

Hope that helps,

Matt - Visual Analytics Ltd

rbecher
MVP
MVP

Hi Onur,

I don't know what's your requirement behind this but it's more difficult to check if anyone of the selected values contains 'a'.

You could do it in an another way by having an associated table:

LOAD * INLINE [
City, A_Flag
Augsburg, 1
Berlin, 0
Chemnitz, 0
Frankfurt, 1
];


..and than summarize over the A_Flag field.

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
rbecher
MVP
MVP

..to explain this more:

=if(sum(A_Flag) / count(distinct City) = 1, 'Letter found: a!', 'Letter a does not exist!')


- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
Not applicable
Author

thank you both ! Big Smile