Spotfire cumulative sum

Spotfire cumulative sum DEFAULT

Recent Posts

Tibco spotfire is a great analytic tool, comparing it with Tableau, how tibco blends data source together is extraordinary, it comes with variety of templets, very convenient to create dashboards and display them in the best visualization, along with automatic create filters from all table entities. I will write another article to comparing this two products later. Today let’s review some very basic functions– cumulative function and max function, you will find it’s so useful, can apply to many kind of reports such as Sales, opportunities, production etc.

Here is a sample structure of the entities we are going to analyze, many data tables is constructed or can be constructed by joining related entities together.

Attribute AAttribute BDatetimeValue in Numeric
A1B110/31/201512.3
A1B111/5/201524
A1B111/6/201512
A2B111/11/20153.5
A2B111/25/20156
A3B212/1/201520.45
AAB212/5/201550
A1B212/18/201512

 

To be more straightforward, here I put a sample table with data in it. Sales Office and customer Id are respectively attribute A and B, Order value and open value is the “value in numeric” column, order date is the datetime column.

SalesOfficeIDCustIDOrder_ValueOpen_ValueOrder_Date
CANADA15226.2546251/3/2017
CANADA15039.844601/3/2017
CANADA15039.844601/6/2017
CANADA15039.844601/9/2017
CANADA15039.844601/9/2017
CANADA5114306.06532.0751/28/2016
CANADA523588.0123588.013/17/2016
CANADA552626.1652626.163/30/2016
CANADA592409.1317265.926/27/2016

 

I’m going to show you how to add another cumulated value column base on this structure.

 

The cumulated value is calculated against different sales Office ID, add up all order value along with the timeline (which is Order date in this case), based on the general structure I gave above, a cumulated value can be calculated against one attribute (an attribute is classification or categories value), along with the timeline.

capture

So I’m going create it and display step by step using the open order table.

capture

Go to Insert in the Nav Bar, select Calculated Column…capture

The insert calculated column window pop out. The function need to summarize the Order value for each office, day by day.

First we need to sum the order valuecapture

By date/time, here we need the ‘OVER’ function, over can be used to calculated value by different categories, time.capture

But we trying to cumulate the value with the previous day and carry the summary into next date, the need to use ‘AllPrevious’ function. ‘allprevious’ can add things up by series of value. Here is datetime.capture

it’s still not sufficient, since the accumulate is for different office. We want to sum things up in different categories. ‘Over’ function can have multiple attributes inside, now we want to sum by office, and previous time, so basically I’m looking for add up each office’s own order dates (since different office can have order on the same date), that’s an intersect of office and date value.

Now it’s a completed calculation, highlighted part is all the function we used.capture

Name it as “cumulate” and add it to the right, look into the number, it’s cumulated exactly the way we need.capture

Create a detail view against this table, select the data will display all when no items are marked in the master view.Capture.PNG

And now you can view the plot and see the in the end how much order totally has for all the time.capture

 

 

Like this:

LikeLoading...

Related

Like this:

LikeLoading...

Sours: https://victoriaxuan.wordpress.com/2017/01/13/tibco-spotfire-cumulative-calculation/

OVER in Calculated Columns


OVER expressions can be used in calculated columns when you want to split the results in a calculated column into separate, fixed, values for different groups, instead of obtaining one result for the entire column. Calculated columns are always calculated on all values in the column, no matter how you filter your data.

When working with calculated columns, there are no axes available to navigate over, as in the case with custom expressions. Instead, you use the over expressions to refer to values in a column or a hierarchy, and calculate one result for each value in the column or hierarchy.

For example, if you have multiple sales transactions each day, you could use 'OVER' to aggregate those values into one value for each day, (Sum([Sales]) OVER [Date]):

Note that the resulting value for each group will be shown on all rows that were included in that calculation (smearing). This means that it is probably not suitable to use such a calculated column in aggregating visualizations (for example, to show in a bar chart). See also Aggregations in Expressions for more information.

By combining OVER with functions such as All, AllPrevious, LastPeriods, etc., you can obtain just about any type of grouped values. For example, the expression Sum([Sales]) OVER AllPrevious([Date]) will give you the cumulative sum of sales for all dates in the column 'Date'.

If you want subgroups for the results to be defined by values in more than one column, and the values from either of those columns make use of any of the OVER functions, then you must also use the Intersect function. For example, look at the example Sum([Oil Production]) OVER Intersect([Well ID], AllPrevious([Year])). To be able to obtain the cumulative oil production per well and year, we need to intersect the well and year.

When you are referring to a hierarchy within an expression, the nodes in that hierarchy become similar to the nodes on an axis (compare to custom expressions), and you can specify which nodes to compare using functions such as All, Previous, Parent, etc. Hierarchies are referenced in expressions using the syntax 'Hierarchy.HierarchyName'. For example, with a hierarchy called 'TimeHierarchy', containing Year and Quarter, the expression Sum([Sales]) OVER (Parent([Hierarchy.TimeHierarchy])) would return the sum of sales per year.

Examples of calculated columns

Example

Expression

Average sales per category and year

Avg([Sales]) OVER ([Category], [Year])

Average sales per category for all years, up until the current year

Avg([Sales]) OVER Intersect([Category], AllPrevious([Year]))

Peak oil per well

Max([Oil Production]) OVER ([Well ID])

Cumulative oil production per well

Sum([Oil Production]) OVER Intersect([Well ID], AllPrevious([Year]))

Sum of sales for top level of a hierarchy

Sum([Sales]) OVER (Parent([Hierarchy.TimeHierarchy]))

 

 

 

 

 

 

 

 

 

 

Sours: https://docs.tibco.com/pub/sfire-analyst/7.14.0/doc/html/en-US/TIB_sfire-analyst_UsersGuide/ncfe/ncfe_over_in_calculated_columns.htm
  1. Orisha connect
  2. Who found san antonio
  3. Managing director salary

Cumulative Sum


Cumulative sums, or running totals, are used to display the total sum of data as it grows with time (or any other series or progression). This lets you view the total contribution so far of a given measure against time. If you want to view the cumulative sum within each period separately, you should use the Year to Date Total method instead.

Example:

esc_cumulative_sum_example.png

Expression:

Sum([Sales]) THEN Sum([Value]) OVER (AllPrevious([Axis.X]))

The first part of the expression calculates the values to compare, i.e., the sum of sales in this example. After the THEN keyword comes the calculation to be done on the selected nodes: the sum of all previous nodes on the X-axis.

Column Selector Controls in Expanded Mode:

esc_cumulative_sum_column_selector.png

Option

Description

Aggregation

This is where you select the Cumulative Sum aggregation.

Display name

Allows you to specify a different display name, instead of the default "Cumulative Sum ([Column Name])".

Axis

Allows you to specify the axis over which to calculate the nodes. Only categorical axes that perform some kind of grouping can show up in the drop-down list. This means that if you only have a grouping on the X-axis then this is the only axis available, whereas if you also have colored by a categorical column then the Color axis will be available as well, and so on.

See also:

Expression Shortcuts Overview

Aggregations Overview

OVER in Custom Expressions

Using Expressions on Aggregated Data (the THEN Keyword)

 

 

 

 

 

 

 

 

 

 

Sours: https://docs.tibco.com/pub/spotfire/6.5.0/doc/html/esc/esc_cumulative_sum.htm

Facebook0Tweet0LinkedIn0

I ran into cumulative sum problems this week. The cumulative sum shown on my bar chart was descending, which is clearly wrong. Read more to find out how this can happen in Spotfire stacked bar charts.

My Project

I am working on a project this week that required cumulative plots. It’s very easy to build cumulative plots in Spotfire using the Cumulative Sum aggregation method on the y-axis or Over and Node Navigation if you are writing a calculated column. In this particular case, I wanted the plot to adjust with filtering, so I used the Cumulative Sum aggregation method on the y-axis.

Cumulative Sum Problem

I was so confident in what I was doing that I just threw this together and moved on to something else. Later on, I was showing the project to a coworker, and they pointed out that my cumulative plot was descending after May. That can’t be right…..the column of data I am using contains a value of 1 or null. The column is adding up 1s. How can it possibly be descending?

Cumulative Sum Solution

The problem is in the Color By. I am using a column to color the bars. After May, the light blue bar doesn’t appear in the data set and thus doesn’t get added up anymore. There is no color in June for the visualization to add to, so it disappears.

And just so you are clear on the math, the visualization below doesn’t have a Color By variable set. In May, the total should be 4121. Instead, my stacked bar chart shows 3417. 4121 – 3417 = 704. 704 is the value of the blue bar.

Technically, there are three possible solutions to this problem, but one is clearly a better solution.

  1. Choose a different visualization type
  2. Remove the Color by variable
  3. Modify the Appearance properties to compensate for missing values (best solution)

Now, we can see the visualization as intended.

Spotfire Version

Content created with Spotfire 7.12.

Post Views:2,400

Tags:cumulative sumstacked bar chart

Sours: https://www.bigmountainanalytics.com/cumulative-sum-problems/

Cumulative sum spotfire

Sveta voiced and Oksana supported her. Indeed, the place was eerie, a forest from all sides where no birds were singing, an impenetrable swamp. And the skeleton of a Red Army soldier who was sitting over our heads. Not very comfortable for tea drinking, but looking for another place to halt was dangerous because of the mines placed in the forest. - There is no turning back.

TIBCO Spotfire - Scatter Plot Configured as a Density Plot

Iron. Oh, yeah. I guess. I don't know. There was an awkward pause in the air.

You will also be interested:

And now, when a piece of feces, which felt about ten centimeters in diameter, was already close to Sasha's anus, although. It had not yet reached his pain became unbearable. Finally, the feces approached the anus, and Sasha began to push hard, squeezing it out of himself. A piece of feces seemed to be tearing him apart.



1580 1581 1582 1583 1584