Jump to content

Differences over year in Text area Calculated value


Remi COURTEY

Recommended Posts

Hello Spotfire Experts,

For one of my client, I have to calculate the evolution over 2 years. It works perfectly in a barchart with the native Difference function (sum([X1]) THEN [Value] / First([Value]) Over (NavigatePeriod([Axis.X],"Year",-1))). But ly client wants to have it into a text area... (a global % evolution).

But the difference function is not working in a Calculated value because Spotfire don't find the Axis.X (its' normal). So I tried to write directly the date field, but it's still not working...

(sum([X1]) THEN [Value] / First([Value]) Over (NavigatePeriod([Date],"Year",-1))

Do you already have this issue

KR

Rmi

Link to comment
Share on other sites

Please create a year column [Year] = Year([Date]) in your data table and use the following in your calculated value:

First(If([Year] = 2020, Sum([Value]))) / First(If([Year] = 2019, Sum([Value])))Adjust this to your needs. The years 2020 and 2019 could be user inputs as well. Just work with doc properties to be more flexible.

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...