Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
drohm002
Contributor II
Contributor 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
Partner - Master

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
Partner - Master

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
Contributor II
Contributor 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
Partner - Master

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