Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

writing expression for only the more recent date

Hi! I numeric value that comes in every day and my table looks like

Header 1Header 2

20170101

1239993
201701021268323
201701031234343

and I want to write a expression for a pie chart that only brings in the last day's value.

how do I do this??

Thank you in advance!!

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

Assuming Header 1 is a number and not date

Sum({<[Header 1] = {"$(=Max([Header 1]))"}>}[Header 2])

or

Assuming Header 1 is a date and not number

Sum({<[Header 1] = {"$(=Date(Max([Header 1]), 'YYYYMMDD'))"}>}[Header 2])

View solution in original post

4 Replies
sunny_talwar

May be like this:

Assuming Header 1 is a number and not date

Sum({<[Header 1] = {"$(=Max([Header 1]))"}>}[Header 2])

or

Assuming Header 1 is a date and not number

Sum({<[Header 1] = {"$(=Date(Max([Header 1]), 'YYYYMMDD'))"}>}[Header 2])

Not applicable
Author

Hi!

This works perfectly !! just one more question. can I add one more if statement within the sum?? for example [Header 3] = 'Y' ?

Thank you so much!

sunny_talwar

Sure, may be like this:

Sum({<[Header 1] = {"$(=Max([Header 1]))"}, [Header 3] = {'Y'}>}[Header 2])

or

Sum({<[Header 1] = {"$(=Date(Max([Header 1]), 'YYYYMMDD'))"}, [Header 3] = {'Y'}>}[Header 2])

Not applicable
Author

AMAZING!!! Thank you