How to show annual values in a customized Bar Graph?

Use this forum to post Vensim related questions.
Post Reply
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

How to show annual values in a customized Bar Graph?

Post by gwr »

Dear Vensim-Support:

I am wondering how to customize a Bar Graph using the possibilities of the text based .vgd-files as needed in order to achieve the following:
  • The model will run at a Time Step significantly smaller than some reporting period (e.g. reporting period is a year for annual reporting and Time Step is a fraction of a year).
  • In order to show reported values, as they might appear in accounting, those flows are integrated within a rolling time frame of one year (e.g. applying Delay Fixed ); the accounting values to be shown in a model based report are then given by a Sample If True - structure so as to ensure that values are taken when the end of any year is reached.
  • These annually sampled values shall then be output in a Bar Graph for each year ended such that the year appears ideally below the vertical bars showing the values
.

While this kind of chart output is very typical for an accounting view and spreadsheet data I am very much struggling to achieve anything like it in Vensim. If I simply take the variable and have it output by the Bar Graph tool over time the annually sampled values will be shown at each time step so that a year will be represented by (1/Time Step) different bars rendering this kind of presentation absolutely useless for smaller time steps needed to achieve a decent model accuracy.

The closest approach I have come up with is using a vgd-file-based definition like the following:

Code: Select all

:BAR-GRAPH accountingFlow
:TITLE Reported Flow by year ended
:VAR accountingFlow { this is a sampled variable for the year ended }
:BAR-TIME 1
:BAR-VAR-TIME
:VAR accountingFlow
:BAR-TIME 2
:BAR-VAR-TIME
...
Unfortunately this is rather cumbersome to do as it would have to be done for each and every variable showing an accounting flow (a kingdom for some feature like OO-inheritance...) and also the times reported (year 1, year 2 , ...) are not shown below the bars.

How can these kind of Bar Graph presentations be achieved in Vensim?

Best regards,

Guido

PS: For completeness, aggregating accounting flows for reporting has previously been addressed here
http://www.ventanasystems.co.uk/forum/v ... ted#p16703
Last edited by gwr on Tue Sep 16, 2014 8:41 pm, edited 1 time in total.
Administrator
Super Administrator
Posts: 4845
Joined: Wed Mar 05, 2003 3:10 am

Re: How to show annual values in a customized Bar Graph?

Post by Administrator »

Can you upload a model with the values you want to display and an example of how it should look (an Excel graph would be fine).

I don't follow at all what you are asking for.

Tony.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: How to show annual values in a customized Bar Graph?

Post by gwr »

Hi Tony,

I have added a simple model showing Capital Expenditure (CAPEX) for vehicle purchases modeled as pulses. You will also find an (ultimately simple) Bar Graph to show annual data for accounting values done by using that ubiquitous spreadsheet tool from Redmond.

In the models' bar graph I have ultimately stopped defining bars after two instances due to boredom doing so.

Note that there are essentially three versions of the monetary flow:
  • CAPEX showing the monetary flows continuously as pulses
  • CAPEX per year continuously reported this is an integrated version of CAPEX showing at any given point in time the value of CAPEX for the past 365 days
  • CAPEX annually reported this is simply the sampled version of the second variable (CAPEX per year continuously reported) at the end of each year
I do want to show CAPEX anually reported in a simple Bar Graph having time on the x- and monetary units on the y-axis and reporting one value (e.g. one bar) per year only.

Hope that helps with regard to helping me.

Best,

Guido
Attachments
Berichtsgroessen.zip
Model and supporting files.
(16.9 KiB) Downloaded 610 times
Last edited by gwr on Mon Sep 15, 2014 4:42 pm, edited 1 time in total.
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: How to show annual values in a customized Bar Graph?

Post by gwr »

A short addendum:

I have modified the formula for CAPEX annually reported as follows:

Code: Select all

CAPEX annually reported = IF THEN ELSE( yearEndedQ, CAPEX per year continuously reported, :NA: ) ~~|
This is at least coming closer to what I want but it still is not really pretty, when compared to the Redmond solution? One reason for this is that - while possible for a regular time graph done with the graph tool - the bar graph will not show times as dates (e.g. as "yyyy") even when chosen in the Control Panel.

Guido
Administrator
Super Administrator
Posts: 4845
Joined: Wed Mar 05, 2003 3:10 am

Re: How to show annual values in a customized Bar Graph?

Post by Administrator »

Sorry Guido, I still do not understand what you are explaining here.

Do you want a bar graph that reports a single variable with one point per year?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: How to show annual values in a customized Bar Graph?

Post by gwr »

Hi Tony,

So far I have broken down my - admittedly a bit abstract - original post to the problem of merging the continuous representation of (accounting) flows in SD-models with what a management accountant would expect when that flow is depicted in chart form. To achieve this kind of presentation/charting the continuous flow will have to be integrated within a rolling time frame (=reporting period) and maybe sampled at certain points in time - e.g. at the end of the year to show values as they would appear in a business report or balance sheet.

In that last case, which I have by now achieved by applying the IF THEN ELSE - construct giving :NA: values for all points in time except the reporting times (in the example given above at the end of any year), I would like to show a proper bar graph over time with the following properties:
  • There is only one bar covering a reporting period (e.g. year end values)
  • Each bar is labeled on the x-axis by a date giving the reporting period (in my example the year in the form 'yyyy' or more general in the form chosen in the Control Panel - ideally with no vertical spacing )

My problem has thus melted down to precisely two issues:


a) I am not able to have dates shown for the times at the x-axis (not to mention that the vertical spacing of times does not please the eye of the spectator)

b) I may have to define customized bar graphs using a vgd - file; but in that case I would have to provide a separate graph definition for each and every variable (?) I would like to show with no dynamic link to variable names which looks like a daunting and highly error-prone task in model developing should one change variable names later on in the process

So what are possible solutions to these problems where hopefully problem b) does not arise at all?

Best,

Guido
Administrator
Super Administrator
Posts: 4845
Joined: Wed Mar 05, 2003 3:10 am

Re: How to show annual values in a customized Bar Graph?

Post by Administrator »

If you cannot get the workbench bar chart to display what you need, but can get a custom graph to do it, then you will need a separate graph for each variable.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: How to show annual values in a customized Bar Graph?

Post by gwr »

Unfortunately I fail to see a way to have even a customized bar graph show dates for the x-axis. Is there a way other than setting up the model with a starting time of "2000" and the like?

Guido
Administrator
Super Administrator
Posts: 4845
Joined: Wed Mar 05, 2003 3:10 am

Re: How to show annual values in a customized Bar Graph?

Post by Administrator »

Have you tried a different time base?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: How to show annual values in a customized Bar Graph?

Post by gwr »

I have tried an alternate Time Base, e.g.:

Code: Select all

Modelyear = TIME BASE( 2000, 1 ) ~ Year ~ |
But that will not work also because the Bar Graph is not affected by the chosen time base at all for some reason. It only uses the model's time base which seems to be a bug or at least unfortunate programming.

So far the only solution I can come up with is setting the model to run from StartYear to EndYear instead of using the more flexible 0 to n setting. So maybe this should be changed for the next release?

Best,
Guido
Wilson
Administrator
Posts: 51
Joined: Thu Mar 06, 2003 5:05 am

Re: How to show annual values in a customized Bar Graph?

Post by Wilson »

Hi Guido,

I'm not sure I fully understand your requirement from this thread.

But, if it is just a case of being able to create a Vensim bar chart with annual results to display, one method I have used in the past is to use subscripting. It is maybe not the most elegant or efficient of methods, but it is easy and quick to set up.
Once the trigger mechanism is in place, you require one new variable for each output you wish to report

Wilson
Attachments
Annual Reporting.mdl
(3.34 KiB) Downloaded 742 times
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: How to show annual values in a customized Bar Graph?

Post by gwr »

Thanks, Wilson! Your solution is very much what I would like to see and seems to be 'as close as one can get' as of now.

I would probably want to put the integration of the flow into a macro (cf. Tom's suggestion for a similar question that I have cited in the PS to my original post) which unfortunately will not be possible for the subscripted output part.
I'm not sure I fully understand your requirement from this thread.
Reflecting upon the way I have worked out my question in this thread so far I am at a complete loss: I cannot conceive of a better way to more concisely state my requirements (which also Tony had problems to come to terms with)? At least for "not fully understanding my requirements" you have managed to come up with a very complete answer. ;-)

Best,
Guido
Post Reply