Discussion Board for collaboration on QlikView Scripting.
Hello and Good Day, I'm currently new in QlikView and I say this is one powerful B.I Tool.
I'm still learning and I need to solve something..
I have a table
I need to compute for Value1 depending on the ID.
The computation is d2-d1, d4-d3, d5-d4
I find it hard to explain, but I just need to compute for Value1 depending on the next Value.
Thank you and Good Day.
P.S This is for scripting Thank you.
Go to Solution.
if([Plate Number] = Peek([Plate Number]), [Odometer Reading] - Peek([Odometer Reading],0)) as peek
why Peek([Odometer Reading],0))?
Do you really want substract the first value from the table in every row?
left join(A)LOAD Date, Time, if([Plate Number] = Previous([Plate Number]), [Odometer Reading] - Previous([Odometer Reading])) as new_peekResident AOrder by Date, Time;
if([Plate Number] = Previous([Plate Number]), [Odometer Reading] - Previous([Odometer Reading])) as new_peek
Order by Date, Time;
I have an expample enclosed.
I d'ont really understand your need.
How are your data when you load it, and what do you expect to do in the script exactly ?
it is from excel file. i loaded it.. and it has a lot of sheets.. so there is a for loop inside..
I have a field I need to compute. As I have said above, the results should be like this:
ID Value Value1
1 1000 0
1 2000 1000
1 500 -1500
2 100 0
2 200 100
Try this expression in Value
use this expression ,u get result
Hi, I will try this in the expression, but I prefer it in the script
You can use this :
Value-Peek(Value),0) as Value1,
Make sure your data are ordered by ID.
I will try this one, can you give me an example if possible? thank you
I tried your computation, yes it is working but the first value should be the one with the '-'