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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rx98u5pq
Contributor III
Contributor III

KPI AGGR or Set Analysis

i have users with different classifications: A.B,C - they can only 1 classification for a given date...but it can change over time.

I want a KPI which counts all users who have a classification of C as their latest classification.  The latest classification is by date...so if a date is selected the users classification may change 

 

e.g. user: John
he was Type A from 2000-2020
he was Type C from 2021 - onwards.

User: Jack

he was Type C from 2000-2015
he was Type A from 2016 onwards

If 2025 was selected  John would be Type C and Jack would be type A
If 2010 was selected John would be Type A and Jack would be type C

If no date was selected, John would be Type C and Jack would be Type A

In a KPI I am not sure how to do this as I don't think we can use set analysis...would it be some form of AGGR using max date per user?

Thanks

Labels (2)
1 Solution

Accepted Solutions
FedericoDellAcqua
Creator II
Creator II

since your report includes historical values i would suggest you to force the selections inside the page with the total KPI and don't make it visible without them. 

Another solution could be include a variable in set analysis and then put a variable setting object beside the KPI. 

Please feel free to leave a like if this comment helps you out! 

Federico

View solution in original post

2 Replies
rx98u5pq
Contributor III
Contributor III
Author

update on what I am trying to do - this is my KPI:

Count(
  DISTINCT
  Aggr(
    If(
      FirstSortedValue(CLASSIFICATION, -VALID_TO) = CLASSIFICATION,
      USER_ID, [Type ID]
    ),
    USER_ID
  )
)

 The KPI tried to latest classification per type id for each user and count them.

this is my attempt before adding in the filters to type C.  The  problem here is that this somehow filters out user ids that have classifications and I am not sure why.

FedericoDellAcqua
Creator II
Creator II

since your report includes historical values i would suggest you to force the selections inside the page with the total KPI and don't make it visible without them. 

Another solution could be include a variable in set analysis and then put a variable setting object beside the KPI. 

Please feel free to leave a like if this comment helps you out! 

Federico