Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to get a new field that is an accumulation of another field.
i can do this on front end - using RangeSum(Above(LoginLogoff,0,RowNo())) . This works just fine.
i am trying to do this during the intial load using - if ((Previous(iKeyPart1)=iKeyPart1),Peek('ActiveLogins'),0)+LoginLogoff as ActiveLogins
It is giving me strange results. it seems to be working until the accumulation reaches 3. Then i start seeing values that dont quite make sense.
Need help!
Try using peek() instead of previous().
Then I think you may need to sort also by EventDateTime?
If you are only interested in the sum(LoginLogoff), you can also use a group by load like
DingoLog2:
LOAD
DingoUserName, StreamId, DistalHostIp, sum(LoginLogoff) as LoginsOnThisHost2
Resident DingoLog group by DingoUserName, StreamId, DistalHostIp;
DROP Table DingoLog;