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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Matching fileds with 'or' and 'and' conditions

Hello, I have a table where I have employees with their Job Titles and Trainings (Training Taken IDs) that those employees have taken.

Now I want to show if employees have taken mandatory (for their positions) trainings.

The twist is that one Mandatory Training can consist of a few Training codes (‘and’ condition) or it can be sufficient to take one of few Trainings (‘or’ condition). So, in my example ‘Cleaner Training 2’ training is done when employee has taken training 5000 or both 4000 and 6000 IDs (5000or(4000and6000)).

I created a table with those possible trainings. For ‘or’ conditions I have used separate records. ‘And’ condition is in one record in one field separated by semicolon (ex. 4000;6000).

The problem is hard to describe but easy when you look at the simplified application which I am attaching.

I created a straight table ‘Mandatory Trainings’ in the application where I want to list all the employees with mandatory trainings and show if the mandatory training is done or not.

In the example I am attaching the ‘Mandatory Trainings’ table last column ‘Mandatory Training done?’ should have all ‘Yes’ as in every case the condition is met.

 

Any help will be appreciated.

Regards,

Mat

 

12 Replies
swuehl
MVP
MVP

Well, looks good Sunny, probably a bit more slick than mine.

I've started development from a table with dimension Name only, so I noticed that when when you keep Mandatory Training in the table, you can simplify my expression a bit (Your expression will return Yes for both Names).

In other words, your seems to perfectly match the requirement, but mat_analyst may need to take care when he wants to use the expression in a different context (this is valid also for my solution).

sunny_talwar

Coming from you, makes me feel good

But I do agree with your assessment that may be if this stays static, it might be easy to carry out in the script

Not applicable
Author

Thank you both Sunny and Stefan. Your solution seems to work however I need to apply it to my application which is much more complex so I can see if I can make it work there.

Let me try it and I will let you know.

Regards,

Mat