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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
_jespers_
Partner - Creator II
Partner - Creator II

Missing values with getSetAnalysis for bookmarks

I'm getting an issue when using getSetAnalysis for bookmarks.

The setup:

const getSetAnalysisDef = {
    "qStateName": "$",
    "qBookmarkId": bookmarkLayout.qInfo.qId
}
 
let bookmarkSetAnalysis = await app.model.engineApp.getSetAnalysis(getSetAnalysisDef);

 

 

First everything looks good and I get the SET-analysis as I want it:

<Dim1={'A'},Dim2={'b'}>

 

But then if I change the position of field and change the name of the field in the script, from DimA to DimAB I get the following:

{<Dim2={'b'}/* MISSING VALUES */>}

 

If I then change back the position and the name of the field in the script to original position and name I get the correct SET-analysis back:

<Dim1={'A'},Dim2={'b'}>

 

So the values must be saved somewhere. Where can these values be found?

The reason why I want to do this is because the client change names and positions of fields sometimmes, but it is still the same dimension containing the same values. So we want to be able to find all the bookmarks that have used the old name and re-create those bookmarks with the new name with the values from the old name.

Thank you!

 

 

Labels (3)
5 Replies
alex_colombo
Employee
Employee

Hey @_jespers_ , not totally clear to me. Are you renaming fields in reload script? If so, I've replicate your scenario and after I rename the field, reload the app, new field name is present in my bookmark, without doing anything. Am I missing something?

_jespers_
Partner - Creator II
Partner - Creator II
Author

The field names are only changed if the field is kept on the same row. If you for some reason move the field to a different position and rename it at the same time the field names in the bookmarks will not change, the field will just disappear from the bookmark. But then if I change the position of the field back to its original position and rename it back to its original name the field in the bookmark will reappear. That means that the information about the missing fields are being stored somewhere, and that is the information I need to be ablo to build an extension for a client that handle users bookmarks when there have been a change to a field.

I will try to give you an example on how to recreate this issue.

This it the original table:

image.png

If I then run getSetAnalysis on my bookmark in the application I get the following:

<Dim1={'A'},Dim2={'b'}>

 

If I then change the table to the following:

image.png

Dim1 has moved position and been renamed.

If I then run getSetAnalysis on my bookmark in the application I get the following:

{<Dim2={'b'}/* MISSING VALUES */>}

 

If I then change the table back to how it was originally:

image.png

And run getSetAnalysis on my bookmark in the application I get the following:

<Dim1={'A'},Dim2={'b'}>

 

So that means that the information about Dim1 is being stored somewhere even though it is not available in the data model since it can retrive the information about Dim1 when it is once again available in the data model. 

So what I need is the complete Set Analysis information without the /* MISSING  VALUES */ part.

alex_colombo
Employee
Employee

Hey @_jespers_  I was able to reproduce the behaviour and I'm aligned with you. I don't know where this information is store, but for sure seems it is not exposed with Engine APIs. Hope I'm wrong, maybe @Øystein_Kolsrud can correct me.

Øystein_Kolsrud
Employee
Employee

I'm not familiar with how the set analysis functionality for bookmarks work, but I do know that the underlying definition of the bookmarks is inaccessible through the APIs. There is for instance a reason why there is not corresponding "SetSetAnalysis" function to "GetSetAnalysis".

Vijay_Vekariya
Employee
Employee

Hi @_jespers_ 

From the example you have mentioned, you are trying to get the Analysis based on a Bookmark.

Bookmarks are not part of the data model and therefore any changes that affects the data model won't update the saved fields inside Bookmarks.

EDIT:

You can do a GetLayout on the Bookmark to get hold of what selections there are in the Bookmark. Then use GetFieldValues to get the fields for the selected values.