Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am loading a very simple table in QlikView with a date and a specific Index, see screenshot below.
Now I would like to calculate in the Load Scirpt the Average between two months, for example for moth 201602: (66,33+66,33)/2= 66,33 in Average and the difference between two months for example in month 201605 64-65=-1 .
I know how to do it with Set Analysis in the Front End unfortunately it must be a calculation in the Script, so can anybody help me with this please?
Kind Regards,
Chris
Try it with interrecord-functions within a sorted resident-load (to ensure the order of records is like your needs), maybe something like this:
load
YearMonth, Date, Average,
rangeavg(Average, previous(Average)) as AverageTwoMonth,
Average - previous(Average) as DiffTwoMonth
resident YourSource order by Date;
- Marcus