HierarchyQuery Class
The HierarchyQuery class represents a hierarchy of symbols in a dimension that can be used in memory or output to a worksheet.
Property Summary
Property IncludeDescriptions As Boolean
Sub/Function Summary
- Sub AddSymbolSpec(symbolSpec As String, [root As String])
- Function Run() As QueryResult
- Sub RunToWorksheet([worksheetName As String], [cell As String])
Properties
Parameter | Description |
---|---|
IncludeDescriptions |
Property IncludeDescriptions As Boolean Sets whether the query results will return a column for the symbol description and the parent description. By default, the value is FALSE. |
Subs/Functions
Parameter | Description |
---|---|
AddSymbolSpec |
Sub AddSymbolSpec(symbolSpec As String, [root As String]) Adds a symbol spec representing the hierarchy you wish to query.
|
Run |
Function Run() As QueryResult Runs the hierarchy query and returns the results in a QueryResult class.
|
RunToWorksheet |
Sub RunToWorksheet([worksheetName As String], [cell As String]) Runs a hierarchy query and places the results into the specified worksheet and cell location.
|
Sample Usage:
Sub RunHierarchyQuery()
On Error GoTo ErrorHandler
Dim result As Longview.QueryResult
Dim query As Longview.HierarchyQuery
Set query = New Longview.HierarchyQuery
Set result = query.Run()
Dim row As Long
Dim column As Long
For row = 1 to result.RowCount
For column = 1 to result.ColumnCount
‘ Place results of symbol query into cells of the worksheet manually
Range(“A1”).Offset(row – 1, column – 1).Value = result.GetCellValue(row, column)
Next column
Next row
ErrorHandler:
If Err.Number <> 0 Then
MsgBox “Unable to run Hierarchy Query (“ & Err.Number & “) – “ &
Err.Description
End If
End Sub