Jump to content

How to create data for a stacked bar or line with different timerange


Ben Amiot 5

Recommended Posts

Hi all,

I'm trying to create a chart that would visualise the "run vs. change cost" of my domain. I'd like to have them stacked up (either bar or line) based on the next 5 years forecast. The idea is to represent something like that:

 

The chart above was manually created, but how would I go about creating the underlying data in Excel or CSV, then visualisethis in Spotfire

I'd like to avoid having to create 12 months x5 years worth of lines in Excel since I will have to maintain that on a regularly basis.

Ben

Link to comment
Share on other sites

Hi Ben,

Here is a simple CAPEX, OPEX Model implemented using Python and Spotfire.

I am using a csv file to provide the input parameters to our models. It currently has 5 fields:

 

Model Type(CAPEX or OPEX),

Line Item- provides the expense description,

Amount(this is the per annum amount for OPEX entries and total amount for CAPEX entries),

Start Period(first day of the starting month where expense is recognised)

End Period(first day of the ending month where expense is recognised)

 

 

This input file is loaded as a Spotfire data table and will be the input parameter to a Python Data Function (dfin).This is the Python data function that does the cost allocation based on the expense type:

 

The output of this data function (dfout) will be returned as a Spotfire data table that will feed the visualisations.

 

Andthis is a sample visualisation:

 

I have attached the input files and the sample dxp that describes the entire process. Your allocation rules may be different to what I have described here and we may need to tweak the python script to reflect the rules that you want.

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