Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
catalin
Partner - Contributor III
Partner - Contributor III

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 - Contributor III
Partner - Contributor III
Author

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 - Contributor III
Partner - Contributor III
Author

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