Jump to content

How to show top 10 peak values of titles in a line graph?


Maeson Vallee

Recommended Posts

So, I have a data set where a row consists of a timestamp, title, and value. What I am doing is showing the growth and decline of each title over time (according to the value). I am doing this through a line graph with x axis being timestamp, y axis being value, and doing line by as the title.

What I am trying to do is only show the titles that have the biggest peak in values (let's say the top 10). And I still want to show the whole line over time, not just that specific peak point. How would I go about doing this? Thank you.

Link to comment
Share on other sites

Hello Maeson!

One way of doing that could be to add a calculated column that contains the peak value (max) for each title, and rank that.

DenseRank(Max([Value]) OVER ([Title]),"desc")

 Note: Using DenseRank, ties are given the same rank value.

You could then filter on that column to only show the desired number of top performers.

(For information on the functions used - see Analyst manual, e.g. for DenseRank, see https://docs.tibco.com/pub/sfire-analyst/12.5.0/doc/html/en-US/TIB_sfire-analyst_UsersGuide/index.htm#t=ncfe%2Fncfe_ranking_functions.htm&rhsearch=denserank&rhhlterm=denserank&rhsyns=%20)

In the example below, the table plot and line chart on top shows all data - the line chart at the bottom only the top two titles.

Top.thumb.PNG.d1da7690d014dcdd39b7af66f9990309.PNG 

Link to comment
Share on other sites

Hi Fredrik,

Is there a way I can do the top growing titles as well (as in which are growing the fastest)? I was thinking of ranking them by the slope of the best line of fit for each title. I was able to get the slope of each title in a different table but am having trouble linking the two so I can filter it.

Link to comment
Share on other sites

Hello again Maeson!

Disclaimer: I'm not a data scientist, so I will not comment on suitable ways for you to perform that analysis (which seems to be approaching forecasting/prediction - there is a lot of content available about how to do that in Spotfire).  

Just a quick note though: For a one time analysis, this static approach (doing a line fit, exporting the fit data, importing the fit data and connecting that to your existing data) may be good enough but a data function based approach (using data functions written in R/TERR or Python) could give you a more seamless dynamic experience. 

If you have no previous experience with this, I would start by watching this:

Dr. Spotfire - Open Office Hours | Forecasting, Visualization, Automation

TIBCO Spotfire Data Function Library: Python and R Scripts for Data Analysis

https://community.spotfire.com/s/article/TIBCO-Spotfire-Data-Function-Library-Python-and-R-Scripts-for-Data-Analysis.

Back to your specific question. If you have a fit in a separate table (in my example below, I just did a straight line fit, exported that data and imported it as a separate table), you could add the desired data - in my case the b column containing the slope - as new columns to your original data table. I matched the data on the Title column which existed in both. See "How to add columns" in the Analyst manual: https://docs.tibco.com/pub/sfire-analyst/12.5.0/doc/html/en-US/TIB_sfire-analyst_UsersGuide/index.htm#t=add%2Fadd_how_to_add_columns.htm&rhsearch=add%20columns&rhhlterm=add%20columns&rhsyns=%20

Like the previous time, I also added a calculated column ("DenseRank(,"desc")), containing the ranked slope (b) values, so I got an ordered list of 1,2,3,4 for easy filtering.

Addcolumns.thumb.PNG.005e073e6d5c3c0bb5e36245cfa1cc42.PNG 

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