Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We have a data set where staff are trained and hold a qualification for a finite period of time. I have created a data model with a fact table that holds one record per person (Staff) per qualification (Training Type) per day that the qualification is valid for. Please see the attached table view.
I can now produce charts that show many staff hold each type of qualification within given date ranges.
The client also wishes to see which staff did NOT hold a particular qualification (or group of qualifications) within a given date range. I would prefer not to add more records to the fact table as I already have 10's of millions of rows and running out of memory.
Is there a set analysis expression I can use? It is not as easy as selecting records that do not equal a Training Type as staff members hold multiple qualifications at a given point in time.
Message was edited by: Michael Fenton Uploaded sample app
I have discovered a simpler solution to this problem. Actually from a post of swuehl a couple of years ago.
This expression gives me what I need: Sum({$<StaffId=E(), QualificationGroup= >} StaffCount)
I found the answer here: http://community.qlik.com/thread/64009
I do not find it intuitive at all, and the syntax checker marks it as incorrect, but it works perfectly and easily.
Now I need to go back and get rid of those unnecessary objects and fields in my data model...
Can you attach sample of your application?
I have attached it now.
Have you tried selecting the date range and training type. Then the excluded values in staff should show what you want?
If so, you can try the e() function (implicit field value definition) maybe something like:
=concat({<StaffName = e() >} distinct StaffName)
when date range and training type is selected.
That is getting closer. However, I don't want all selections excluded. For example I only want to see Staff that do have a Shift on the dates selected, but not have the Training Type selected.
I have solved this with a combination of Alternate State and the excluded element function in set analysis.
Sum({$ <StaffId = E({1<TrainingType=Unqualified::TrainingType>})>}StaffCount)
This seems to be giving me the results I expect.
Thanks to swuehl for pointing me in the right direction.
I have discovered a simpler solution to this problem. Actually from a post of swuehl a couple of years ago.
This expression gives me what I need: Sum({$<StaffId=E(), QualificationGroup= >} StaffCount)
I found the answer here: http://community.qlik.com/thread/64009
I do not find it intuitive at all, and the syntax checker marks it as incorrect, but it works perfectly and easily.
Now I need to go back and get rid of those unnecessary objects and fields in my data model...