How to subtract the current row data from the next row in a calculated column in Spotfire

How to subtract the current row data from the next row in a calculated column in Spotfire

book

Article ID: KB0070296

calendar_today

Updated On:

Products

Spotfire Analyst TIBCO Spotfire Business Author

Description

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.

Issue/Introduction

This article shows how to use an OVER expression, and the Next option, to subtract the current row data from the next row in a calculated column in Spotfire.

Environment

All

Resolution

To achieve the goal, you can make use of the OVER functionality in 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.

Additional Information

Attachments

How to subtract the current row data from the next row in a calculated column in Spotfire get_app