Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
Showing results for 
Search instead for 
Did you mean: 
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

@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