Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two columns with 5 rows,
A{1,2,3,4,5} And B{6,7,8,9,10}
I want to subtract 2nd value from column A from 1st value of column B.
(i.e. I want to subtract (n+1)th value from column A from (n)th value of column B.)
So there will be one column with 4 rows, in this case, (6-2 = 4), (7-3 = 4), (8-4 = 4), (9-5 = 4)
(n-1 values in general)
What is the script for this expression?
Can we use an in built function Previous? if yes, how?
Thanks,
Himanshu
Min(B)- min(A,2)
or
top (B)_top(A,2)
try out this
above(a,1)-b use this expression
Hi,
Try this script,
TableName:
LOAD
PreviousB - A AS NewColumn,
A, B
WHERE Previous(B) <> NULL();
LOAD
Previous(B) AS PreviousB,
A,
B;
LOAD * INLINE [
A, B
1, 6
2, 7
3, 8
4, 9
5, 10
];
Hope this helps you.
Regards,
Jagan.