Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jw22
Contributor II
Contributor II

Load maximum Date per Dimension

Hello Qlik Community,

is there a way to load only the maximum (latest) date per  dimension?

So, I have the following Table (example) with different Production lines, the Article number, the Status and the Date of the Status. I only want to load the maximum Date per production line:

So in the example only the green marked Data:

jw22_1-1671466841654.png

 

Thanks!

Regards,

Johannes

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

As below

Main:

load 

ProductionLine,ArticleNumber,Status,Date

From SomeSource;

Inner Join(Main)

Load ProductionLine,Max(Date) as Date

Resident Main

Group by ProductionLine;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

5 Replies
BrunPierre
Partner - Master
Partner - Master

For the date column, use this expression.

Aggr(FirstSortedValue(Date(Date),-Date),[Production Line])
vinieme12
Champion III
Champion III

As below

Main:

load 

ProductionLine,ArticleNumber,Status,Date

From SomeSource;

Inner Join(Main)

Load ProductionLine,Max(Date) as Date

Resident Main

Group by ProductionLine;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
jw22
Contributor II
Contributor II
Author

Hello,

is it also possible to only do it in the chart diagram, not in the script?

Thanks!

SingSing16
Contributor III
Contributor III

I have very similar issue, I am interested too how to do this on diagram (by measure/dimession)

vinieme12
Champion III
Champion III

You can restrict data using a calculated dimension

=Aggr(If(Datefield=max(Datefield),Datefield), ProductionLine) 

Uncheck show null values for this dimension

 

 

Or

 

 by adding the same condition to the measures instead; as below

=Sum(Aggr(If(Datefield=max(Datefield),SomeMeasureField), ProductionLine) )

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.