Jump to content

How to sumifs based on multiple criteria on spotfire


Valerine Tng

Recommended Posts

Hi,

Let say I have this table, I want to calculate the profit in each period (i.e Revenue- Expense = Profit for period 1, 2, 3)

How do I use custom expression to achieve that

 

 

 

Description

Period

Activity

 

 

Revenue

1

100

 

 

Expense

1

50

 

 

 

 

 

 

 

Revenue

2

200

 

 

Expense

2

100

 

 

 

 

 

 

 

Revenue

3

300

 

 

Expense

3

200

Link to comment
Share on other sites

Option 1: Get the Profit in the same table

Here you could use this calculated column:

First(If([Description]="Revenue",[Activity],NULL)) OVER ([Period]) - First(If([Description]="Expense",[Activity],NULL)) OVER ([Period])

Option 2: Get your data to the right shape

Create a new data table with a Pivot operation and then simply subtract the columns:

[Revenue] - [Expense]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...