The Lib class is a utility class which provides custom BQL scalar and aggregate functions.
tsEvent(BTimeSchedule sched) - used to display event information for a specific BTimeSchedule. The display format is '<event state> from h:mm a - h:mm a'.
bql:select rootSchedule.displayName as 'Schedule',displayName as 'Weekday',vykonPro:Lib.tsEvent(day.time) as 'Event 1',vykonPro:Lib.tsEvent(day.time1) as 'Event 2' from schedule:DailySchedule
dsEvent(BDailySchedule sched) - used to display event information for a specific BDailySchedule. The display format is '<event state> from h:mm a - h:mm a'.
bql:select rootSchedule.displayName as 'Schedule',vykonPro:Lib.dsEvent(monday) as 'Monday' from schedule:WeekSchedule
dEvent(BDaySchedule sched) - used to display event information for a specific BDaySchedule. The display format is '<event state> from h:mm a - h:mm a | <event state> from h:mm a - h:mm a'.
bql:select rootSchedule.displayName as 'Schedule',displayName as 'Weekday',vykonPro:Lib.dEvent(day) as 'Events' from schedule:DailySchedule
wsEvent(BWeekSchedule sched) - used to display event information for a specific BWeekSchedule. The display format is '<day of week> | <event state> from h:mm a - h:mm a | <event state> from h:mm a - h:mm a'.
bql:select rootSchedule.displayName as 'Schedule',vykonPro:Lib.wsEvent(week) as 'Monday' from schedule:WeeklySchedule
isToday(BWeekdaySchedule sched) - Returns true if the current day of the week matches the specified sched day of the week.
bql:select rootSchedule.displayName as 'Schedule', displayName as 'Weekday', day.time.start as 'On', day.time.finsih as 'Off' from schedule:DailySchedule where vykonPro:Lib.isToday(days)
showFacets(BControlPoint point) - Display the control point value in a BQL query with the facets applied.
bql:select name as 'Zone',vykonPro:Lib.showFacets(ZoneTemp) as 'Zone Temp',vykonPro:Lib.showFacets(FanStatus) as 'Fan Status',vykonPro:Lib.showFacets(Occupancy) as 'Occupancy' from baja:Folder
showFacets(BStatusValue value) - Display the value in a BQL query with the facets applied.
bql:select name,out.value,vykonPro:Lib.showFacets(out) as 'Value With Facets' from control:ControlPoint
tags() - Display a comma separated list of implied and direct tags assigned to the component. The result includes the tag name and value if applicable.
bql:select slotPath, vykonPro:Lib.tags() from baja:Component
tagsForNs(BString ns) - Display a comma separated list of implied and direct tags assigned to the component for the specified dictionary name space. The names space is specified using the short hand reference such as n for the Niagara dictionary or hs for the Haystack dictionary. The result includes the tag name and value if applicable.
bql:select slotPath, vykonPro:Lib.tagsForNs('n') from baja:Component
hasTag(BString id) - Returns true if the component has the tag specified by the id argument applied. The id argument format is <nameSpace>:<tagName>.
bql:select slotPath, vykonPro:Lib.tags() from baja:Component where vykonPro:Lib.hasTag('hs:geoCountry')
tagValue(BString id) - Return the specified tag and value if assigned to the component, otherwise return an empty string. The id argument format is <nameSpace>:<tagName>.
cycles(boolean value) - used to display the number of state transitions of the boolean value in the data set. This would typically be used in conjunction with a history query while rolling up records.
history:/vykonProTest/lights?period=weekToDate|bql:select timestamp.toDateString as 'Date',vykonPro:Lib.cycles(value) as 'Total Cycles'
cycles(boolean state, boolean value) - used to display the number of state transitions of the boolean value for the specified state in the data set. This would typically be used in conjunction with a history query while rolling up records.
history:/vykonProTest/lights?period=weekToDate|bql:select timestamp.toDateString as 'Date',vykonPro:Lib.cycles(value) as 'Total Cycles',vykonPro:Lib.cycles(true,value) as 'On Cycles'