Jump to content

How to perform operations over data from different rows and create a plot?


Pavinkumar R
Go to solution Solved by Gaia Paolini,

Recommended Posts

I've a data set similar to the one in below (X,Y & Condition). I've plotted line graph with color by 'Condition'. In the given example case, I've two plots (as there are two conditions 'A' and 'B').

What I want to do now is, to create a single plot which shows the difference/sum/multiplication/division between these two plots. Basically, I want to understand if there is a way to add a calculated row similar to calculated column in Spotfire? Or Any other way, In which we can achieve what I'm looking for?

Thanks in advance.

image.thumb.png.ee61be3e095d83afd771899cf48f4e21.png

Link to comment
Share on other sites

  • Solution

From what you said, I would try to apply a pivot transformation to your data, then you can create as many column combinations in the plot as you need.

I have slightly changed your sample data (the values for A were all 1, and the X values were repeated). See attached dxp.

Basically I created a pivot table by adding a new data table (press + then choose 'Other' then choose the existing data table) so as not to overwrite the original, then applied a pivot transformation so that the resulting table looked like this (right):

image.thumb.png.f282032594e0bb995dc9f4f041b3847a.pngThen I plotted the pivoted table using as columns: Y_A, Y_B then Y_A-Y_B, Y_A+Y_B resulting in this plot:

image.thumb.png.ebeeb7e0731d86470336d80d5558d717.png

Link to comment
Share on other sites

  • 2 weeks later...

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