Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Object ID as parameter

Is it possible to pass the Object ID as a parmater within an expression

E.g. Window Title:

= "This object's ID is" & ObjectID

would display

This object's ID is CH56

I'm thinking of using this in conjunction with an EVAL statement to retreive expressions from a database based on the Object ID.

3 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

You can certainly do this using macros. You can run a macro on-open which will initialize some veriables. These variables then you can use in your expressions:

set s = ActiveDocument.Sheets("Main")
set so = s.SheetObjects(0)
set v = ActiveDocument.Variables("myObjectID")
v.SetContent so.GetObjectId, true

May be I am not understanding what exactely you are trying to achieve. Hope this help you with what you need.



Annette_Steinrücken
Former Employee
Former Employee

Hi,

The function GetObjectID is available if you use a macro.
This is an exttract from the API guide.

rem ** get unique object ID for first object on sheet Main **
set s = ActiveDocument.Sheets("Main")
set so = s.SheetObjects(0)
id = so.GetObjectId
msgbox("ID = " & id)

Regards, Annette

Not applicable
Author

So, I have a number of elements on a page, and I am trying to automate the generation of their expressions.

In particular I plan to store the expression for each object in a database, and load this database in.

I would then like to retrieve the expression for a particular object based on the object ID.

Essentially I would like to have =MaxString(If (objectID=this.object.ID,eval(expression))))