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: 
williamdeboos
Contributor
Contributor

Help with set analysis and date filtering

Hi there,

I am looking to build an expression within one of my table charts that will pull back the [Actual Qty] result for the most recent OrderDate regardless of the current OrderDate selected. The most recent OrderDate will be equal to today's date. Whilst the result should not vary as the OrderDate selection changes, I would still need other selections to apply (i.e. country, client, etc). In essence I am looking to compare this OrderDate locked value vs current selection.

I have tried these two below so far but neither work as intended and instead both vary as the OrderDate selection changes. Any ideas? Thanks very much.

Sum ( $ { < OrderDate = { ' = Max ( OrderDate ' } > } [ Actual Qty ] )

Sum ( $ { < OrderDate = { ' = today() ' } > } [ Actual Qty] )

 

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

See the attached qvw:

=Sum({1<OrderDate = {"$(=date(max({1}OrderDate),'M/D/YYYY'))"}>}[Actual Qty])

View solution in original post

6 Replies
m_woolf
Master II
Master II

Maybe something like:

Sum ( 1 { < OrderDate = { " = Max ({1} OrderDate " } > } [ Actual Qty ] )

williamdeboos
Contributor
Contributor
Author

That is not pulling back anything for me unfortunately.

m_woolf
Master II
Master II

I had the first 1 in the wrong place:

Sum (  { 1< OrderDate = { " = Max ({1} OrderDate " } > } [ Actual Qty ] )

williamdeboos
Contributor
Contributor
Author

Thanks. Expression is coming up as ok but still no results coming through sadly? All values are 0.

m_woolf
Master II
Master II

See the attached qvw:

=Sum({1<OrderDate = {"$(=date(max({1}OrderDate),'M/D/YYYY'))"}>}[Actual Qty])

williamdeboos
Contributor
Contributor
Author

This worked - thank you so much! I had to change the date format to match my date ('M/D/YYYY' -> 'DD/MM/YYYY') but this is exactly what I was after. Thank you again.