Product: TIBCO Spotfire®
How to subtract the current row data from the next row in a calculated column in TIBCO Spotfire
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 below steps.
To achieve the goal, you can make use of the OVER functionality in TIBCO Spotfire client:
1) Below is the screen-shot of the original data table.
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.
Note that a sample analysis file "Difference.dxp" has been attached to this Knowledge Base article.
- OVER Functions (TIBCO Spotfire Analyst 10.10.2 User's Guide)