Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Set Analysis nested Max() not using Dimensions

I am using the following nested expression in set analysis to dynamically select a date period :

Max({<Transaction={'Last Known Stock Qty'}, Ledger={Actuals}>} Date)

Here is the full expression which I would like to return a bespoke date range for each dimension value:

Sum({<Transaction={Bill}, Ledger={Actuals}, Date={">$(=Max({<Transaction={'Last Known Stock Qty'}, Ledger={Actuals}>} Date)) <=$(=Max({<Transaction={Channel}, Ledger={Actuals}>} Date))"}>} [Billed Qty])

The expression delivers the correct date when used on its own and honours the dimensions, however when it is nested it seems to ignore the dimensions and returns the global Max() date.

Is this normal behaviour?  If it is, how do I get the nested expression to honour the dimension values.

 

Labels (3)
1 Reply
Highlighted


@cmsjamesgreen wrote:

Is this normal behaviour? 


Yes it is. Set analysis is evaluated once per chart and not per dimension. This is what makes set analysis perform better than if statement.

In your case, you can try to use Aggr() with if statement to accomplish what you are trying to do. Or you can also investigate FirstSortedValue() function