Qlik Community

Ask a Question

Integration, Extension & APIs

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

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
dselgo_eidex
Partner
Partner

qElemNumber Persistence

Hello, I am currently working on a custom bookmarking solution in my web application. I know that there is support for creating bookmarks through the Bookmark API, but for reasons I won't go bore you with I decided to go with a customized approach. As part of it, I am using the Engine API to retrieve the selected values of certain fields, and store those field's qElemNumber separately for later use. It occurred to me that because these qElemNumbers are Qlik Sense's way of internally indexing field values, they may not match when data is added/modified.

For instance, User A makes selections on Country and selects the following values:

  1. {qText: "Argentina", qElemNumber: 1}
  2. {qText: "Britain", qElemNumber: 2}
  3. {qText: "United States", qElemNumber: 3}

User A then decides they want to make a bookmark for their current selections. We store the values [1, 2, 3] in our custom bookmark. A week goes by and User A is using our app and wants to apply the bookmark they had previously made. We retrieve the stored values and call the SelectListObjectValues() method from the Engine API. The problem is, 2 days ago the app was reloaded and "Japan" was added as a possible country.

My question is, will the qElemNumbers still match what they were previously, or will this cause the bookmark to make the wrong selections? Also, if anyone knows how Qlik Sense stores bookmarks internally, it would be good to know.

Labels (3)
1 Solution

Accepted Solutions
rwunderlich
Luminary Alumni
Luminary Alumni

The qElemNumbers are assigned to the values in script load order.  Loading different values or even the same set of values in a different order will change the assigned qElemNumbers 

The Qlik Sense bookmarks retains the set of qText values, or the search argument if a search was used. 

 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

3 Replies
rwunderlich
Luminary Alumni
Luminary Alumni

The qElemNumbers are assigned to the values in script load order.  Loading different values or even the same set of values in a different order will change the assigned qElemNumbers 

The Qlik Sense bookmarks retains the set of qText values, or the search argument if a search was used. 

 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

dselgo_eidex
Partner
Partner
Author

Awesome! Thanks for the info Rob!

dselgo_eidex
Partner
Partner
Author

I discovered something through my testing and thought I would share it. If you make a ListObject using an expression for the field (e.g. =if(Continent = 'North America', Country) or =aggr(only({1<Continent = {'North America'}>} DISTINCT Country, Country)), the qElemNumbers of the values that are returned through GetListObjectData() will NOT be the same as the qElemNumbers of 'Country'.

I assume this is because Qlik Sense is creating some transient field based on the expression rather than just reducing the field.

Just thought I'd share 🙂