Regarding the previous question which I have posted: calculation the difference for same column for the specific rows in Spotfire
I have a new problem for it, below is the sample:
The new function that i want to realize is,
- searching for the next nearest TYPE=0 for TYPE=1
- if the TYPE=1 has nearest TYPE=0, then mark it as 'T' in a new calculated column, otherwise as NULL
Data Rules:
- Status column contains{1,2} in order, the default value of the null space is same as the last nearest Status value above it.
- Type column contains only 0 and 1 randomly
output should be like this:
the solution what i have tried:
If(([type]=1) and (first([type]) OVER (intersect(previous([type]),AllNext([status])))=0),"T",Null)
it looks fine, but the problem is in each status group, for example the last TYPE=1(the 5th row) in the first status=1 group, it has not next nearest TYPE=0, so the judgement would be Null. But based on the code, it is T! :(
any suggestion and idea for it? thanks a lot'! PS: some details:
- the first Type Value of the status is NULL
- Other null space in the status column can be filled as below, if it is helpful for the expression :):