Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
atlantis_shahri
Contributor III
Contributor III

Max Date finding

Date.png

Hey guys, I need only the maximum dates for each Product in a table.

Like Bread 19/11/2017

        Sugar 28/11/2017

        Tea     18/11/2017

Tried something like this =Only({<PDate={'$(=max(Date))'}>} PDate) for Serial date 2. Didn't work.

Any kind of help is much appreciated and thanks in advance

Regards

Shahriar.

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Seems to be 'PDate' is not properly formatted.

Try this.

Table:

LOAD Product,Date(Date#(PDate,'DD/MM/YYYY')) as PDate;

Load * inline
[
Product, PDate
Sugar, 11/11/2016
Bread, 12/11/2016
Sugar, 11/11/2017
Bread, 12/11/2017
Sugar, 12/10/2017
Bread, 12/10/2017
Sugar, 28/11/2017
Bread, 19/11/2017
Tea,  18/11/2017
]
;

Chart:

Dimension:  Production

Expression :  Max(PDate)

View solution in original post

10 Replies
shraddha_g
Partner - Master III
Partner - Master III

Can you share sample date?

What is the data present in PDate?

atlantis_shahri
Contributor III
Contributor III
Author

This is the test source data.

Table:

Load * inline

[

Product, PDate

Sugar, 11/11/2016

Bread, 12/11/2016

Sugar, 11/11/2017

Bread, 12/11/2017

Sugar, 12/10/2017

Bread, 12/10/2017

Sugar, 28/11/2017

Bread, 19/11/2017

Tea,   18/11/2017

];

shraddha_g
Partner - Master III
Partner - Master III

Where is Date field from expression?

Only({<PDate={'$(=max(Date))'}>} PDate)

shraddha_g
Partner - Master III
Partner - Master III

Try,

Only({<PDate={"$(=Date(max(PDate),'DD/MM/YYYY'))"}>} PDate)

VishalWaghole
Specialist II
Specialist II

Try below expression,

Dimensions is your product

Expression =Max(Total <Product> Date)

Thanks,

Vishal

VishalWaghole
Specialist II
Specialist II

Try below expression,

Dimensions is your product

Expression =Max(Total <Product> PDate)

Thanks,

Vishal

settu_periasamy
Master III
Master III

Seems to be 'PDate' is not properly formatted.

Try this.

Table:

LOAD Product,Date(Date#(PDate,'DD/MM/YYYY')) as PDate;

Load * inline
[
Product, PDate
Sugar, 11/11/2016
Bread, 12/11/2016
Sugar, 11/11/2017
Bread, 12/11/2017
Sugar, 12/10/2017
Bread, 12/10/2017
Sugar, 28/11/2017
Bread, 19/11/2017
Tea,  18/11/2017
]
;

Chart:

Dimension:  Production

Expression :  Max(PDate)

atlantis_shahri
Contributor III
Contributor III
Author

This doesn't work.

atlantis_shahri
Contributor III
Contributor III
Author

This only works when Load Product,Date(Date#(PDate,'DD/MM/YYYY')) as PDate; is added. Thanks.