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

Revision history [back]

Someone can correct me if I'm wrong, but I don't think any of the built-in sqlFile methods can handle custom subcategories; I think the categories and subcategories are hard-coded into OpenStudio.

One way to get the value you want is with a simple SQL query:

query = "SELECT Value FROM TabularDataWithStrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses By Subcategory' AND RowName='Pumps:HW Pumps' AND ColumnName='Electricity' AND Units='GJ''"

value = sql_file.execAndReturnFirstDouble(query).get

Someone can correct me if I'm wrong, but I don't think any of the built-in sqlFile methods can handle custom subcategories; I think the categories and subcategories are hard-coded into OpenStudio.

One way to get the value you want is with a simple SQL query:

query = "SELECT Value FROM TabularDataWithStrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses By Subcategory' AND RowName='Pumps:HW Pumps' AND ColumnName='Electricity' AND Units='GJ''"
Units='GJ'"

value = sql_file.execAndReturnFirstDouble(query).get

Someone can correct me if I'm wrong, but I don't think any of the built-in sqlFile methods can handle custom subcategories; I think the categories and standard EnergyPlus subcategories are hard-coded into OpenStudio.

One way to get the value you want is with a simple SQL query:

query = "SELECT Value FROM TabularDataWithStrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses By Subcategory' AND RowName='Pumps:HW Pumps' AND ColumnName='Electricity' AND Units='GJ'"

value = sql_file.execAndReturnFirstDouble(query).get