+1 vote
2.0k views

Is there an automatic way of exporting the results visible in the "Contribution Tree" to a datasheet for Excel or for OpenOffice (.ods /.ots extensions) ?
It should be a quite simple routine which automatically expands some of the contributions (those above a set percentage), copy them and paste them in a single data sheet, named for example with the name of the impact indicator under consideration.
This could be repeated, automatically, for all the impact indicators, creating a file with multiple sheets.
Manually copying and pasting appears very frustrating and time-consuming.
Thanks, and hopefully waiting for an answer from you all.

in openLCA by (300 points)
edited by

3 Answers

+1 vote
by (113k points)
selected by
 
Best answer
Hi, Frank, yes that is an interesting idea but as Jonas has said, you for now need to expand what you want to export from the tree, or expand the entire tree, select it (ctrl+a), right-click and copy, and paste to excel. This is - we think - already quite powerful. However, no automatic support directly of expanded trees; for the other excel exports, also no automatic export routine exists in openLCA as you are maybe aware. It could be added via python. If someone wants to post an example, that would be nice of course.
0 votes
by (23.6k points)
edited by

You can export results to Excel via the Export to Excel button in the main menu.

Open source office suites such as LibreOffice can handle *.xlsx files which you can then import into *.ods/*.ots.

However, at the point of writing (openLCA 1.7), the contribution tree is not included in the generated Excel files and have to be exported manually via copy and paste.

by (300 points)
Hi Jonas,
as you can verify and know, the result of the "Export to Excel" button in OpenLCA 1.7 is a file .xlsx consisting of the following 4 sheets:
1) the sheet "Calculation setup", reporting the summary information:   Product system - Reference process - Reference process location - Product – Amount - Impact method - Normalisation & weighting set - Allocation method - Cutoff  -  Date;
2) the sheet "Inventory" reporting all the input and output flows (Life Cycle Inventory – LCI) of the aggregated system process resulting from the product system created;
3) the sheet "Impacts", reporting the results, in a quantitative way, of the impact indicators;
4) the sheet "Process flow contributions", which is the hugest, reporting the matrix flows – processes.

As you can observe, the type of information shown in the "Contribution Tree" reporting in particular the relative contribution as a percentage of each process to each impact indicator (along with its absolute value) is missing in the Excel file produced.
I think that these are very valuable information, and in a much more usable format then those contained in the Sankey diagram, which is exportable just as an image, and not in tabular form (apart form the diversity of the approach).

Therefore the basis of the question remains.
by (23.6k points)
I updated my answer accordingly.
0 votes
by (420 points)

I've created a script that will automatically expand the contribution tree above a specified threshold after which the data can easily be copied and pasted into any other program.

You can find the script here https://ask.openlca.org/4499/how-to-export-contribution-tree-data

...