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

Values per Max Date for ID

Hi All,

I am working with numerous IDs and I want to return 2 different pieces of information

1) The Max Date of the Last Actual Data Received

2) The Max Date of the Last Estimated Data Received

I have tried the below expression with ID as the dimension but it only returns a list of all IDs with an Actual Value for the 22/01/2018 (Being the Max Date on the Report)

Only({<DATA_VALUE={ACTUAL}, DATE_TIME_DAY={'$(=max(READ_DATE_TIME_DAY))'}>} DATE_TIME_DAY)

However it should also return sites who's last date of Actual Data is less than the 22/01/2018 as well.

The estimated part is something similar as it is using the same expression:

Only({<DATA_VALUE-={ACTUAL}, DATE_TIME_DAY={'$(=max(READ_DATE_TIME_DAY))'}>} DATE_TIME_DAY)

Any help is greatly appreciated,

Thanks,

Tim

1 Solution

Accepted Solutions
sunny_talwar

May be try this

FirstSortedValue({<DATA_VALUE = {'ACTUAL'}>} DATE_TIME_DAY, -READ_DATE_TIME_DAY)

FirstSortedValue({<DATA_VALUE -= {'ACTUAL'}>} DATE_TIME_DAY, -READ_DATE_TIME_DAY)

View solution in original post

4 Replies
sunny_talwar

May be try this

FirstSortedValue({<DATA_VALUE = {'ACTUAL'}>} DATE_TIME_DAY, -READ_DATE_TIME_DAY)

FirstSortedValue({<DATA_VALUE -= {'ACTUAL'}>} DATE_TIME_DAY, -READ_DATE_TIME_DAY)

Anonymous
Not applicable
Author

Hi Sunny,

Works brilliant.

Thank You!

Anonymous
Not applicable
Author

Hi Sunny,

Further to this I have came across several exceptions where we have received two different sets of Non Actual Data on the same day. This is currently returning blank.

How would I amend your expressions so it also only returns the non actual with the highest VERSION number?

Thanks,

sunny_talwar

May be this

FirstSortedValue({<DATA_VALUE = {'ACTUAL'}>} DATE_TIME_DAY, -(READ_DATE_TIME_DAY+DATE_TIME_DAY/1E10))

FirstSortedValue({<DATA_VALUE -= {'ACTUAL'}>} DATE_TIME_DAY, -(READ_DATE_TIME_DAY+DATE_TIME_DAY/1E10))