Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Master II
Master II

Re: Help with set analysis and date filtering

See the attached qvw:

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

View solution in original post

6 Replies
Highlighted
Master II
Master II

Re: Help with set analysis and date filtering

Maybe something like:

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

Highlighted
Contributor
Contributor

Re: Help with set analysis and date filtering

That is not pulling back anything for me unfortunately.

Highlighted
Master II
Master II

Re: Help with set analysis and date filtering

I had the first 1 in the wrong place:

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

Highlighted
Contributor
Contributor

Re: Help with set analysis and date filtering

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

Highlighted
Master II
Master II

Re: Help with set analysis and date filtering

See the attached qvw:

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

View solution in original post

Highlighted
Contributor
Contributor

Re: Help with set analysis and date filtering

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.