Discussion board where members can get started with QlikView.
When we calculate the case total at the same grain it works fine.
If we calculate case total at case reference level it does not working, this is because of all case secure are added together(case total = case secure + case settled)
For total at case reference level we need to take the latest case secure and add it to the sum of all the paid amount for that case reference.
Please find attached spread sheet, and can anyone suggest how to achieve/calculate 'Total for the case (latest case secure + total paid)'
Well, try like:
Rangesum(Firstsortedvalue(Secure, -Date), sum(TotalPaid))
View solution in original post
Do you have a field/logic to define which transaction is latest ?
Sorry, I have Date field to define the latest transaction,
I have tried the below expression, and it is working only if we select any case references.
If you don't have a time field to decide the recentness and the load order defines the same, you could create a new field like:
and then at UI use firstsortedvalue() like:
As set analysis works once per chart, this can't be done using set analysis, use below
sum(aggr(if(Date =max(total <Reference> Date),Secure),Reference))+sum(TotalPaid).