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: 
dselgo_eidex
Partner - Creator III
Partner - Creator III

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
Partner Ambassador/MVP
Partner Ambassador/MVP

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
Partner Ambassador/MVP
Partner Ambassador/MVP

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

dselgo_eidex
Partner - Creator III
Partner - Creator III
Author

Awesome! Thanks for the info Rob!

dselgo_eidex
Partner - Creator III
Partner - Creator III
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 🙂