Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

waqqas2426
Contributor

Tricky Average!

Hi Experts!

I'm trying to do some enhancement to the solution I mentioned here:Simple Average Problem

I now have extra data which is now concatenated to the same table in the Simple Average Problem.

tab7.PNG

Showing the average against ID was easy but I now want to be able to show last three date sale average against Service Order, Service Name and Future Dates. Is this possible?

The resultant straight table should look like this:

tab9.PNG

I'm attached the data and the app if anyone wants to give it a try. Thanks

Tags (2)
3 Replies

Re: Tricky Average!

May be this

=Aggr(Avg(TOTAL <ID> Aggr(If(Rank(Date) < 4, Sale), ID, Date)) , ID, ServiceOrder, FutureDates)

Capture.PNG

waqqas2426
Contributor

Re: Tricky Average!

Hey Sunny thanks for your help. This is exactly what I wanted. The only thing is that as soon as I make a selection, all calculations disappear.

tab10.PNG

I want to be able to make service order selection and be able to see the relevant calculations as well.

Re: Tricky Average!

Try this:

=Aggr(Avg({<ServiceOrder>}TOTAL <ID> Aggr(If(Rank(Only({<ServiceOrder>}Date)) < 4, Only({<ServiceOrder>}Sale)), ID, Date)) , ID, ServiceOrder, FutureDates)