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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Prithika
Contributor III
Contributor III

KPI

hello

i have a dataset for student attendance for two days(today and yesterday)

i have to use selection for date

i need the kpi to show today's attendance without any selection and if a date is selected i need it to display the selected date's  attendance.

for example

present  | today      |           64

absent   |  today        |          6

present |   yesterday      |  60

absent  |   yesterday    |     10

if no selection are made, the KPI should display the  today "Present " value (64), if yesterday is selected in filter pane "60" should be displayed or if today is selected in filter pane 64 should be displayed. can someone help.

Labels (1)
1 Solution

Accepted Solutions
Tanish
Partner - Creator
Partner - Creator

Hi Prithika,

You can use Set analysis to achieve this result.

For Example , If you need to count Student

Count({<Date =  $("=Max(Date)") >}StudentID)

This count only that studentID which is there in the Max Date, now suppose if from the filter you select any other date then this KPI will display that date data.

 

If your count of student is already aggregated like you mentioned then you can use this:

Status      | Date            | Count

present  | today      |           64

absent   |  today        |          6

present |   yesterday      |  60

absent  |   yesterday    |     10

Sum({<Date = { "$(=Max(Date))" }  ,   Status   =  {'Present'}  >}    StudentID   )

Hope this will help....🙂

Thanks,

Tanish

 

View solution in original post

3 Replies
Tanish
Partner - Creator
Partner - Creator

Hi Prithika,

You can use Set analysis to achieve this result.

For Example , If you need to count Student

Count({<Date =  $("=Max(Date)") >}StudentID)

This count only that studentID which is there in the Max Date, now suppose if from the filter you select any other date then this KPI will display that date data.

 

If your count of student is already aggregated like you mentioned then you can use this:

Status      | Date            | Count

present  | today      |           64

absent   |  today        |          6

present |   yesterday      |  60

absent  |   yesterday    |     10

Sum({<Date = { "$(=Max(Date))" }  ,   Status   =  {'Present'}  >}    StudentID   )

Hope this will help....🙂

Thanks,

Tanish

 

Prithika
Contributor III
Contributor III
Author

THANK YOU SO MUCH👏

christopher23cwx
Contributor
Contributor

Does this formula work with any type of application? because with me it's an error. I don't know what I'm doing incorrectly. Because I am doing an article for college using this source https://papersowl.com/examples/gun-control/ and I want to write about gun control, I think it would solve many problems, but besides that I need these formulas to do the calculations, but it irritates me that they don't work.