Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

malradi88
Contributor

Using OR/IF function in Set Expression

Dear Qlik Community,

I hope this finds you well. I am currently working on a data set that consists of 3 fields (Trainee ID, Economic Literacy Score, Value Chains Test Score).

I have the following set expression:

Count({$<[Value Chains Test Score]={'>=7'},  [Economic Literacy Score]={'>=7'}>}[Trainee ID])

This expression gives me the # Trainees that took both Value Chains & Economic Literacy trainings and scored >7 in both. It is worth nothing that all trainees take both trainings.

I would like to amend it to say: Count the number of Trainees (distinct without repetition) that scored at least 7 in either the 'Value Chains training' or Economic Literacy training'. I can't seem to get the syntax right for it though. Or perhaps this is best answered using addition and a distinct function that covers both parts of the addition expression?

If anything comes to mind I would be most appreciative.

Best,

Mohammed

1 Solution

Accepted Solutions
MVP
MVP

Re: Using OR/IF function in Set Expression

May be this

Count({$<[Value Chains Test Score]={'>=7'}>+<[Economic Literacy Score]={'>=7'}>}[Trainee ID])

4 Replies
MVP
MVP

Re: Using OR/IF function in Set Expression

May be this

Count({$<[Value Chains Test Score]={'>=7'}>+<[Economic Literacy Score]={'>=7'}>}[Trainee ID])

malradi88
Contributor

Re: Using OR/IF function in Set Expression

Thank you Sunny!

malradi88
Contributor

Re: Using OR/IF function in Set Expression

Hi Sunny,

If there is a third training I want to insert into the set expression but all values for that training are currently null what can I do? I tried continuing with the pattern of >+<[Training3] but it then counted every null value. Thank you for your help.

Best,

Mohammed

MVP
MVP

Re: Using OR/IF function in Set Expression

Can you show by an example as to what exactly you are trying to do?