Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
cantona_rules
Partner - Contributor II
Partner - Contributor II

Check if part of a string can be found in another part of a string

Hi.

I have a filter where the user can choose organization.

I have a table where I have the lowest part of a organization and I have create a path.

Let’s say in the table I have the lowest organization = A3 and the path I have created in data is A1,A2,A3

The organization filter in the report is like:

A1

A2

A3

B1

B2

and so on ...

Let’s say the User in the App choose A2 in the filter, then I would like to match the path(column in data) in the data because A2 is part of A1,A2,A3.

This can be done with match(A2,'A1','A2','A3'). BUT then let’s say the user of the app chooses 2 or more values from filter e.g. A2 and B1.

Then I have this list by concat 'A2', 'B1' or 'B1', 'A2' depending on the order that is chosen. How can I then check if the list of the filter (which should be evaluated one by one) is part of the path column that I have created in data).
That is, I would like to first check if A2 is part of the path column and then check if B1 is part of the path column. That is, I would like to loop across then selections of organizations to see if any of them are in the path list.

Labels (2)
5 Replies
Kushal_Chawda

@cantona_rules  what is the end goal if you are able to find the match in Path?

cantona_rules
Partner - Contributor II
Partner - Contributor II
Author

Hi @Kushal_Chawda , thanks for your interest

My goal is to only show those rows which are part of the chosen organization filter and the user should be alble just to filter some part of the "upper" part of a hierarchy , like this:

cantona_rules_0-1682506208180.png

 

So I can’t filter only on the organization because as you see in my first example (marked with RED),I would like to display in my report the 2 rows marked with red, because both of those rows contains A2 (which is the org chosen in this example.) . You can say that the user is interested to see information about all rows in data which are part of the chosen "upper" organization.

The GREEN example. Here the end user is choosing only the lowest part og the hierarchy.

marcus_sommer

Looked a bit more complicated as needed - why not just providing the main- and sub-hierarchy and the user selects the wanted ones? It might be one click more but it keeps the things simple and comprehensible for the users.

If you really want to implement a selection-logic in which n upper/lower dimension-values of a related field should becomes possible you may consider the use of The As-Of Table - Qlik Community - 1466130.

cantona_rules
Partner - Contributor II
Partner - Contributor II
Author

thx for the reply @marcus_sommer  . well I guess this would'nt be that complicated in other front-ends but I guess it is in Qlik. I will take a look at the link you posted. 

thanks again

Kushal_Chawda

@cantona_rules try below. Use filter Org to filter out organization.

Data:
Load * Inline [
Path | Lowest Org
A1,A2,A3 | A3
B1,B2,B3,B4 | B4
X1,X2,X3 | X3
A1,A2,A3,A4 | A4 ] (delimiter is '|');

Org:
Load SubField(Path,',') as Org;
Load FieldValue('Path',RecNo()) as Path
AutoGenerate FieldValueCount('Path');

join(Org)
Load FieldValue('Path',RecNo()) as Path
AutoGenerate FieldValueCount('Path');

Org_final:
NoConcatenate
Load *
Resident Org
where Index(Path,Org);

Drop Table Org;