Discussion Board for collaboration on QlikView Scripting.
If I do
max(MyField - above(MyField))[/code ]I get "-" because above() return "-" for the first row. My question is to kow how to avoid this ?Best regards,Jérémy</body>
What do you want to do exactly ?
If you want to compare the max value of a field wihtin a dimension and the previous one (that means the max value of a field with the previous dimension value), the syntax is :
And if you want to avoid the NULL value, you can use a test like :
MyFiled is a field with counter values. What I want to do is to find the maximum consumption between 2 counter values.
I want fo find the value 10 because 10 - 0 returns the max
You could make another column which has the difference between those numbers and take the max of that column
0 010 1012 216 4
Max(diff) = 10
Try to compute a new column in your data script using the 'previous' function, for example :
LOAD id, counter
counter-if(isnull(previous(counter)),0,previous(counter)) as gap
Then you can have the max(gap) in your report.