Jump to content

Limiting row displays without impacting underlying calculation


Cassandra Kuang

Recommended Posts

Hi,

I am trying to use Spotfire to monitor our process. We currently have data for 30 lots. I only want to show data for the last 6 lots on a bar chart with reference lines showing the average and average+/-SD of all 30 lots.  I am also trellising the columns so relevant columns/parameters can be displayed on one page. I tried using data limiting and show/hide items, but it would change the results on the average and other calculations to the average of the last 6 lots while it should be the average of all 30 lots.

Thanks,

Cassanadra 

 

Link to comment
Share on other sites

Hi Cassandra,

One option is to use calculated columns

Let's consider this source table

image.png.7ef8abc518f5af11af3ba393167000b8.png

if I plot a bar chat with avg and +/- stdv then I'll obtain this chart

image.thumb.png.730f6e443fb9c35b3eb0f4ccd19a0cfc.png

Like you said, if you filter it will also impact the lines and their values

image.thumb.png.8c4d821c4c44dd20fdc2b0e5ee772c60.png

My proposal consists of first creating these columns

  • avg ::: Avg([Value]) OVER (All([Lot]))
  • stdev ::: StdDev([Value]) OVER(All([Lot]))
  • avg-stdev :::: [avg]-[stdev]
  • avg+stdev :::: [avg]+[stdev]

then add the three lines like this 

image.thumb.png.776dc90b22012e98dfb08fe2c15a1d63.png

image.png.58b771d3a263e849dd1c7fe191b35a70.png

 

you will keep your lines' values if you filter

image.thumb.png.080ebceda8e3d6e165a84e73c43b598e.png

PS:
By the way, you can also just use the x-Axis zoom slider if that works for you.

 

  • Like 1
Link to comment
Share on other sites

Hi Oliviver and Gaia,

Thanks for providing a solution. However, I have a total of ~ 60 parameters that I need to track and compare against the living average values (average of all lots). It is not that efficient to make so many calculated columns. Is there a better way to handle this more efficiently?

Thanks,

Cassandra

Link to comment
Share on other sites

Hi Gaia,

This is a living data table with more new data available as production continues. If I choose to update manually, it means I need to calculate the avg of all 60 parameters manually and update the value manually, correct? If so, are there any alternatives?

Thanks,

Cassandra

Link to comment
Share on other sites

Just want to make sure that we are on the same page.

Consider the sample plot that Olivier created (thanks for creating that, Olivier). The average of 30 lots is 0.57.  Since it is a living data table, I will have data from lot 31, lot 32, lot 33, lot 34, and more to come. If I don't click the update button, the average stays the same, which is the average of first 30 lots. My goal is to have the chart to show only data from the latest 6 lots: lot 29, 30,31,32,33 34, and the average will be updated to the average of all 34 lots. 

image.thumb.png.080ebceda8e3d6e165a84e73c43b598e.png

 

Thanks for your help in advance.

Link to comment
Share on other sites

To add more details, here is my current setup with data from the sample table. Since there are data from 17 lots, the lot number is getting cut off (x-axis). To resolve this, we decided only to show data/the bars of the last 6 lots but the average of all 17 lots. This is very helpful for us as we need to monitor process performance and we can do that by comparing data of the latest lot to the historical average.  Help this help make the goal clear.

image.thumb.png.1d835830cdc0d3ee346ef3fa543ff6f7.png

Link to comment
Share on other sites

Hi Cassandra

Thanks for the information. If your data size allows, I'd suggest changing your data table structure to a tall-skinny by unpivoting your data like this

image.thumb.png.f6cdb60e548c1c004ad51535c341d2cf.png

and calculate the new columns like this 

  • avg ::: Avg([Value]) over (Intersect(all([Lot#]),[Parameter]))
  • stdev ::: Stdev([Value]) over (Intersect(all([Lot#]),[Parameter]))
  • avg-stdev :::: [avg]-[stdev]
  • avg+stdev :::: [avg]+[stdev]

You can then add the lines from the data table and choose the suitable calculated values.

I am attaching my dxp example.

PS: a tall skinny table will also make things easier for the visualizations' setup.

Sample Table for Autofilter and Auto-Calculation_WK17AUG2024 - Sheet1.dxp

Link to comment
Share on other sites

Hello,

Could this be a solution?

image.thumb.png.01c39f1c8d78767d7561700e839380c7.png

 

Here what i did: 

1- Calculated the Lot number and formatted it as Integer (i assume this logic would need to evolve if the 2 characters change)
2- Unpivoted as suggested by Olivier
3- Calculated a new column to isolate the value corresponding of the last 6 lots

case WHEN [ID]>(UniqueCount([ID]) - 7) then [Value] END 

Again, you will surely have to adapt it based on your lot coding logic

4- Create a Combination Chart with a) the Value of the newly calculated column and b) an Average line with all Values and of course

here the avg formula that i used: 

Avg([Value]) OVER (All([Axis.X]))

5- Filter based on the new column, i put greater than 0 for the example but you could set it to Not Null or something else that better matches your needs.

image.png.d4957051e119c9ba13149a6465563185.png

 

6- Add the Treillis, adapt Y axis scale for each treillis panel and voila :)

Not sure it will satisfy your needs but maybe it will help in your thinking.

Vincent

Combination Chart Try.dxp

  • Like 1
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...