PlantSight: Working with string array in queries


I'm trying to get to the unit display label of the properties using a KindOfQuantity. I'm able to get to the KindOfQuantity of the properties but not to the display label defined in UnitDef. It looks like 'KindOfQuantity.PresentationUnits' is of type 'array of strings' that isn't supported by functions like 'instr' and 'substring'. I'm testing this using iModelConsole.

select SchemaName,
       sch.Alias SchemaDisplayAlias,
       cls.Name ClassName,
       cls.DisplayLabel ClassDisplayLabel,
       prop.Name PropertyName,
       prop.DisplayLabel PropertyDisplayLabel,
       udef.DisplayLabel UnitDisplayLabel,
   from meta.ECSchemaDef sch
        join meta.ECClassDef cls
           on sch.ecinstanceid =
        join meta.ECPropertyDef prop
           on cls.ecinstanceid =
        left join meta.KindOfQuantityDef KOQ
           on = KOQ.ecinstanceid
        left join meta.UnitDef udef
           on substring( KOQ.PresentationUnits, instr(KOQ.PresentationUnits,'[u:')+3, instr(KOQ.PresentationUnits,']')-instr(KOQ.PresentationUnits,'[u:')-3 ) =
   where = 'ProcessFunctional'
   order by,,

Does someone has a workaround to this or another idea on how to get tom the unit display label associated to a property?

Best regards


Parents Reply Children
No Data