Skip to main content
Announcements
Jan 15, Trends 2025! Get expert guidance to thrive post-AI with After AI: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gogreen
Contributor II
Contributor II

Set Analysis Syntax

Hello Qlik fam!

I am having some technical difficulty with the syntax of set analysis. I am trying to get the count of possible values on top of already calculated possible values universe.

For example there are 10 workers in a factory who can get a different type of work to do every day and every worker can get any possible work type to do. Now the requirement is to get the count of workers who are purely tied with certain work types but not the other ones

Let the work types be

A,B,C,D,E,F,G,H,I,J where A,B,C,D,E,F belong to Category 1 and E,F,G,H,I,J belong to Category 2

Requirement 1: To get the count of workers with work type A,B,C from already calculated workers who strictly belong to combinations of A,B,C,D,E but not any of F,G,H,I,J with some flag condition (Flag value is specific to worker irrespective of work type and work day and should be considered for both numerator and denominator).

Requirement 2: To get the count of workers with work type A,B,C from already calculated workers who belong to both A,B,C,D,E and F,G,H,I,J sets overall but not just within the subsets of A,B,C,D,E or F,G,H,I,J separately with some flag condition (Flag value is specific to worker irrespective of work type and work day and should be considered for both numerator and denominator).

Attaching the sample data file with dummy data and .qvf file with what I have as of now here.

Any help is appreciated. Thanks.

Sai.

15 Replies
marcus_sommer

It wasn't meant as a full solution to your question else just as an idea to the kind of the conditions. To pick up a subset of data which restrict data from another limited subset is a rather straightforward approach but to create a product of multiple subsets could become more complicated.

- Marcus

Ksrinivasan
Specialist
Specialist

hi,

Solution 1: =count({$<[Work type]= {'A','B','C'},[Worker id]= {'2'},[Flag]= {'1'}>}Flag)

Solution 2: =count({$<[Work type]= {'A','B','C'},[Worker id]= {'1','6','7','8'},[Flag]= {'1'}>}Flag)

regards,

ksrinivasan,

 

gogreen
Contributor II
Contributor II
Author

Got it. Thank you!

Ya, I think this is the case of multiple subsets.

Sai.

gogreen
Contributor II
Contributor II
Author

Thanks!

But I think the solution should be without mentioning [worker id] at all in the filters inside as there are a lot of them.

Thanks,

Sai.

Ksrinivasan
Specialist
Specialist

Hi, in your derivation you have mentioned worker I'd.  Will you derive  without Id and post that example. 

Ksrinivasan.

gogreen
Contributor II
Contributor II
Author

Hi,

I mentioned worker ids with respect to work types. Was showing an example of what rows qualify for each calculation. Do you think sample data from the file and my initial description might help?

Thanks,

Sai.