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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
drohm002
Creator II
Creator II

Creating a calculated dimension

Hello, I am trying to create a calculated dimension that only returns the yellow rows below, the last two cases done each day based on Out Room Time. Any ideas? I feel like I need to use AGGR but im not sure in what sense. Thank you!

drohm002_1-1706113765638.png

 

 

Labels (4)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

T:
LOAD
Date,
[Out Room Time],
Case
From < SourceTable > ;

NoConcatenate
F:
LOAD Date,
FirstSortedValue([Out Room Time], -[Out Room Time]) as [Out Room Time],
FirstSortedValue(Case, -[Out Room Time]) as Case
Resident T
Group By Date;

LOAD Date,
FirstSortedValue([Out Room Time], [Out Room Time], 2) as [Out Room Time],
FirstSortedValue(Case, [Out Room Time], 2) as Case
Resident T
Group By Date;
DROP Table T;

View solution in original post

3 Replies
BrunPierre
Partner - Master II
Partner - Master II

T:
LOAD
Date,
[Out Room Time],
Case
From < SourceTable > ;

NoConcatenate
F:
LOAD Date,
FirstSortedValue([Out Room Time], -[Out Room Time]) as [Out Room Time],
FirstSortedValue(Case, -[Out Room Time]) as Case
Resident T
Group By Date;

LOAD Date,
FirstSortedValue([Out Room Time], [Out Room Time], 2) as [Out Room Time],
FirstSortedValue(Case, [Out Room Time], 2) as Case
Resident T
Group By Date;
DROP Table T;

drohm002
Creator II
Creator II
Author

So I would have to do this in the load script and not actually build a calculated dimension in the chart?

BrunPierre
Partner - Master II
Partner - Master II

In this situation, I think the most effective approach would be at the backend.