1

EnergyPlus End Uses By Subcategory Table from eplusout.sql

I am using DB Browser for SQLite to read the eplusout.sql. I am having trouble with End Uses By Subcategory table. It does not appear as I would like it to appear.

Here is what I have tried:

Select ColumnName as "Utility", Rowname as "End Use", Value as "Subcategory",   Units
from TabularDataWithStrings WHERE ReportName = "AnnualBuildingUtilityPerformanceSummary"
and TableName = "End Uses By Subcategory"

Can anyone suggest any edits to the above query or if the information exists elsewhere and two tables need to be joined.

gmehta75's avatar
23
gmehta75
asked 2017-11-21 18:39:43 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-11-24 08:51:42 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Can you provide examples of how it appears and how you would like it to appear?

shorowit's avatar shorowit (2017-11-22 10:31:08 -0500) edit

I would like it to appear as Electricity, Natural Gas, District Heating....etc under column titled Utility, end uses under column titled End Use, Subcategories such as Fans, zone exhaust fans, etc under column titled Subcategory, energy consumption under column titled Value and GJ, m3, etc. under column titled Units.

When I run the above query, the Utility column includes the text Subcategory repeated and after a number of rows Electricity, Natural Gas, etc. appear. All the information is there but its not organized the way I would like it to be.

gmehta75's avatar gmehta75 (2017-11-22 15:58:29 -0500) edit
add a comment see more comments

1 Answer

0

The problem is the structure of the underlying SQL, it doesn't really has a subcategory column so it ends up being positional...

Try this query:

SELECT ColumnName as "Utility", Rowname as "End Use", Value,   Units
FROM TabularDataWithStrings 
WHERE ReportName = "AnnualBuildingUtilityPerformanceSummary"
AND ReportForString='Entire Facility'
AND TableName = "End Uses By Subcategory"
// Optional: AND ColumnName != "Subcategory"

If you just pivot the Utility column it should look like the HTML report I think. There is no pivot in SQLite, so I'd just do it somewhere else (python is my goto for that), but you could write a verbose JOIN query to do that in SQLite

Julien Marrec's avatar
29.7k
Julien Marrec
answered 2017-11-23 08:48:56 -0500, updated 2017-11-23 08:49:13 -0500
edit flag offensive 0 remove flag delete link

Comments

Note that EnergyPlus v9.3 and newer makes it easier to query the End Uses by Subcategory table. See https://github.com/NREL/EnergyPlus/pu... implemented by @Julien Marrec.

shorowit's avatar shorowit (2020-09-02 17:32:51 -0500) edit
add a comment see more comments