Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Prithika
Contributor III
Contributor III

PREVIOUS DATE

i have attendance data of 4 dates

17/08/2023,

18/08/2023,

19/08/2023,

21/08/2023

i have to show presentees for previous date.

i using filter pane for this date.

if no selection are made maximum date's previous date presentees should be displayed.

if selection is made, the selected  date's  previous date presentees should be dispalyed.

for example:

if no selection is made , the maximum date is 21/08/2023 so it should show 19/08/2023 presentees.

if 18/08/2023 is selected it should show 17/08/2023 presentees.

is it possible? can someone help?

Labels (1)
1 Solution

Accepted Solutions
Gabbar
Specialist
Specialist

There are multiple ways to do it , like you can just remove the maximum date from data and then use Max(Date) in set analysis, So you will get presentees of selected date and selected date will be one less than maximum date.

The other way would be to join an extra datefield and use that datefield in set analysis but now showing that datefield.

like you dates are and if you put rowno() on them and sort them in required way you get data like:-

Table1:

Date1,Rn
17/08/2023,1
18/08/2023,2
19/08/2023,3
21/08/2023,4

After this you can take Table1 as resident table and Subtract 1 or add 1 on rowno() field and than join them.
So your table 2 will be like:

Date2,Rn
17/08/2023,0
18/08/2023,1
19/08/2023,2
21/08/2023,3

if you join them you will get the Date2 field automatically less than Date1 or greater than Date1 depending on requirement.
Then you can create a filter with Date2/Date1 but use Date1/Date2(If Date1 in filter than Date2) in set expression.

View solution in original post

2 Replies
Gabbar
Specialist
Specialist

There are multiple ways to do it , like you can just remove the maximum date from data and then use Max(Date) in set analysis, So you will get presentees of selected date and selected date will be one less than maximum date.

The other way would be to join an extra datefield and use that datefield in set analysis but now showing that datefield.

like you dates are and if you put rowno() on them and sort them in required way you get data like:-

Table1:

Date1,Rn
17/08/2023,1
18/08/2023,2
19/08/2023,3
21/08/2023,4

After this you can take Table1 as resident table and Subtract 1 or add 1 on rowno() field and than join them.
So your table 2 will be like:

Date2,Rn
17/08/2023,0
18/08/2023,1
19/08/2023,2
21/08/2023,3

if you join them you will get the Date2 field automatically less than Date1 or greater than Date1 depending on requirement.
Then you can create a filter with Date2/Date1 but use Date1/Date2(If Date1 in filter than Date2) in set expression.

Prithika
Contributor III
Contributor III
Author

THANK YOU !!