Qlik Community

Ask a Question

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
catalin
Partner
Partner

Create a transient object to hold the measures in an app

Hello, dear Qlikers!


I am using the latest version of the QlikSense SDK and I am trying to get rid of the obsolete function 

 

App.GetMeasureList.Items

 


I am trying something like the snippet bellow, but for sure it is fundamentally broken as something is escaping me related to how to attach to the transient object the qMeasureListDef.

My question is: where should one bind the MeasureListDef in the transient object's properties in such a way that when I call its GetLayout() to be able to output the list of measures in the given app? 


What I have so far:

Dim measlist As MeasureListDef = New MeasureListDef With {.Type = "measure"}
Dim transient_obj = app.CreateGenericSessionObject(prop:=New GenericObjectProperties With {.Info = New NxInfo With {.Id = "ML01", .Type =
"MeasureList"}, .MetaDef = CType(measlist, NxMetaDef)
})
Dim mes = transient_obj.GetLayout
1 Solution

Accepted Solutions
catalin
Partner
Partner

OK, it seems that I found the solution. So I will leave it here for anyone looking for the same thing in the future.

Cheers, guys!

Dim props As GenericObjectProperties = New GenericObjectProperties With {.Info = New NxInfo With {.Id = "ML01", .Type = "MeasureList"}}
props.Set("qMeasureListDef", New MeasureListDef With {.Type = "measure"})
Dim mes = qsApp.CreateGenericSessionObject(prop:=props).GetLayout().Get(Of MeasureObjectViewList)("qMeasureList")
For Each m In mes.Items
Log.Information(m.Info.Id & " - " & qsApp.GetMeasure(m.Info.Id).NxLibraryMeasure.Def)
Next

 

View solution in original post

1 Reply
catalin
Partner
Partner

OK, it seems that I found the solution. So I will leave it here for anyone looking for the same thing in the future.

Cheers, guys!

Dim props As GenericObjectProperties = New GenericObjectProperties With {.Info = New NxInfo With {.Id = "ML01", .Type = "MeasureList"}}
props.Set("qMeasureListDef", New MeasureListDef With {.Type = "measure"})
Dim mes = qsApp.CreateGenericSessionObject(prop:=props).GetLayout().Get(Of MeasureObjectViewList)("qMeasureList")
For Each m In mes.Items
Log.Information(m.Info.Id & " - " & qsApp.GetMeasure(m.Info.Id).NxLibraryMeasure.Def)
Next

 

View solution in original post