Product: TIBCO Spotfire®
How to subtract one row from another
Product: TIBCO Spotfire (desktop client / Analyst / Professional)
Version: All
OS: All Supported Operating Systems
If you want to calculate the difference between two rows (a row and its next row) and have the result in a calculated column, then follow the instructions in the Resolution section below.
To achieve the goal, you can make use of OVER functionality present inside TIBCO Spotfire Analyst. The following are the sample steps.
1). Below is the screen-shot of the original data table.
Customer_name Sales
A 5
B 6
C 6
D 6
E 7
F 7
G 8
H 8
2). Go to Insert Menu >> Calculated Column. Use the expression -> Sum([Sales]) OVER ([Customer_Name]) - Sum([Sales]) OVER (Next([Customer_Name])).
Below is the screen-shot of the final table.
Customer_name Sales Difference b/w rows
A 5 -1.00
B 6 0.00
C 6 0.00
D 6 -1.00
E 7 0.00
F 7 -1.00
G 8 -1.00
H 9
Comments
0 comments
Article is closed for comments.