Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a QVD with meter readings data in it. This is made up of one row for each reading, therefore each customer will have numerous rows of readings.
This data will have:
Customer Number - Reading Date - Meter Reading
1234 01/09/2010 100
1234 01/12/2010 110
1234 01/02/2011 135
I need to work out the difference between the last reading and the reading before, for each customer. So for the example above the difference would be 25. I can identify the latest reading by MAX(Meter Reading), but can't think how to subtract the second highest reading?
Can this be done in either the script or via an expression in a chart table?
Pretty sure you can actually just subtract max(Meter reading, 2), max takes a parameter for the rank as well as for the data field.
Hi,
You can do this using Peek() function in script. Peek function will not work in Charts.
- Sridhar
Hey Hi,
Kindly Find the attached file for your solution.
Regards
Pretty sure you can actually just subtract max(Meter reading, 2), max takes a parameter for the rank as well as for the data field.
Of course. Didn't even think of that, works fine, thanks!