Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
this is the situation, i've a table like this
id | in | out | result |
---|---|---|---|
a | 14 | 11 | 3 |
b | 17 | 23 | -6 |
c | 86 | 56 | 30 |
d | 43 | 32 | 11 |
this is the load script:
LOAD id,
in,
out
FROM ....
and result = in - out
Now i'd like a filter where i can group the result value, for example:
result < 0
result > 0 and result < 10
result > 10 and result < 20
result > 20 and resul < 30
so i can filter only the values that i want.
Can i create a filter on the calculated field "result"?
Hi,
I would first in script use the Peek function to calculate your Result column.
Something like
LOAD Date,
IN,
Out,
IF(ROWNO()=1,
IN - Out,
Peek(Result,-1)+ (IN - Out)
) AS Result
FROM YourTable,
Then you could either do a proceeding load and use an if statement to calculate your buckets or front end use the Class() Function to so the result in the buckets.
A Deminsion some like
CLASS(Result,10,'Bucket')
Mark