TSQL_Newbie
TSQL_Newbie

Reputation: 821

TIBCO SPOTFIRE Time on y-axis (avg duration)

New user to Spotfire, I'm struggling to find a way to display the average time on the y-axis with a date range on the x-axis.

The only options presented to me when entering the duration column to the y-axis are:

Count UniqueCount CountBig Range

I was looking for the simple option of Average to show a simple line graph or bar chart of the average duration per day or month or week etc.

UPDATE: This is what I am trying to achieve but built in Excel enter image description here

Anyone else come across this same issue?

Many Thanks

Upvotes: 2

Views: 1907

Answers (1)

S3S
S3S

Reputation: 25142

Here are some steps to get what you want.

  • Insert a calculated column DatePart('mm',[yourDateColumn]) and name it [Month]
  • Insert a calculated column Avg(TimeSpan([yourDateColumn])) OVER ([Month]) and name it [AvgSpan]
  • Place the [Month] column on your X axis
  • Use First([AvgSpan]) on your Y-Axis.

You could also use Time() instead of TimeSpan() in the expression if that's more what you want. It's hard to see what you are basing the duration off of since usually that requires a Start and End time. If you are basing the duration off the beginning of that day then you can use this logic.

  • Insert calculated column DateDiff("ss",DateTime(Date([dateField])),[dateField]) and name it [Duration]
  • On your X Axis use <BinByDateTime([yourDateColumn],"Year.Month",1)>
  • On your Y Axis use Avg([Duration])

Upvotes: 1

Related Questions