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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Is there any way to get an objects table easily?

Hey guys, I'm just wondering if I can get a system table with all table names and table fields, why I can't get a table with the id's of the existing objects and their caption names???

Until now, I was doing a macro looping over all sheets and get all the ids of the objects "enabling dynamic data update". But right now I have 10 sheets and more than 50 objects, so my document got stuck in the process because of the big amount of data.

This is my macro that loops over all sheets and objects (obviously it got stuck because of the big amount of operations):

function getSheetObjects

     for i = 0 to ActiveDocument.NoOfSheets - 1   

             set ss= ActiveDocument.GetSheet(i)

             arrCurrentSheet = split(ss.GetProperties.SheetId,"\")

             currentSheet = arrCurrentSheet(1)   

             Objects = ActiveDocument.GetSheetByID(currentSheet).GetSheetObjects             

             For j = lBound(Objects) To uBound(Objects)   

                 If Objects(j).GetObjectType > 9 Then 'Charts       

                     arChartId = split(Objects(j).GetObjectId ,"\")              

                     chartId = arChartId(1)       

                     set obj = ActiveDocument.GetSheetObject(chartId)               

                     caption = obj.GetCaption.Name.v               

                     query = "INSERT INTO Objects ('Id Object','Name Object') VALUES ('" & chartId  & "','" & caption  & "')"

                     ActiveDocument.DynamicUpdateCommand(query)             

                    End If              

             next       

    next        

end function

Any ideas about how to improve that??

Many thanks in advance!!

4 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi Marcel,

I'm using v10 and there is an option to export the structure to a file.

Community.png

Hope this solves your needs.

Regards,

Fernando

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks Fernando for your quick answer. In fact yes, you can export, import the structure. But the point is how to do it dynamically.

I mean, you can get easily a system table  right clicking the button "system Table" :

systemTable.png

But I want the same with objects.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Marcel,

I think the cleanest way to do this would be to use the -prj feature of QV10. A document could "self load" the files from it's -prj directory to get all the meta information it could possibly want.

-Rob

http://robwunderlich.com

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks Rob, I'll find out what's this feature in the documentation, and I'll try it.

Regards, Marcel.