Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

The problem is the structure of the underlying SQL, it doesn't really has a subcategory column so it end 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

The problem is the structure of the underlying SQL, it doesn't really has a subcategory column so it end 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