Skip to main content
Announcements
Jan 15, Trends 2025! Get expert guidance to thrive post-AI with After AI: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
amandeep_dhak
Contributor II
Contributor II

Refresh Hypercube based on selections

Dear Team

I have connected to a hypercube from an app and retrieved a value from a field into an KPI object num(sum(Sales),'#,##0') in a mashup (Qlik Sense SaaS). I have also have a field selector where the user can make selections but when the user makes selections the value in the KPI does not change. I believe there must be a callback function on selection to refresh the hypercube. Any advice would be appreciated.

I have also had a look at Glitch. If someone has an simple example, please could you share.

Thanks

Amandeep

Labels (4)
4 Replies
Øystein_Kolsrud
Employee
Employee

Depending on what APIs you are using, it might be that you need to hook into the an "onChanged" event. Whenever selections are made, the engine will return a set of change notifications that indicate which objects need to be refreshed. For Enigma.js you have this event:

https://community.qlik.com/t5/Design/Dissecting-the-Engine-API-Part-5-Multiple-Hypercube-Dimensions/...

If you are not receiving any change notifications for your KPI object, then it might be that your KPI and the field selector are some how connected to different engine sessions.

More low level information on the engine API can be fond in this series of blog posts:

https://community.qlik.com/t5/Design/Dissecting-the-Engine-API-Part-5-Multiple-Hypercube-Dimensions/...

This post describes the concepts of handles and change notifications:

https://community.qlik.com/t5/Design/Let-s-Dissect-the-Qlik-Engine-API-Part-2-Handles/ba-p/1737186

amandeep_dhak
Contributor II
Contributor II
Author

Hi Mate

 

Thanks for your reply. I am currently using Qlik's Capability API. From your posts, would I need to switch to enigma or can it be done via the Capability API?

 

Thanks

Amandeep

Aiham_Azmeh
Employee
Employee

Hi @amandeep_dhak ,

Depending on the method you are using - but assuming that you are using the createCube as an example, you should be able to register listeners or trigger getLayout() on the returned model.

I recommend you to just explore, in debug mode/console, the returned promised value from the methods you use in capability APIs and then check for the enigmaModel

 

hope this helps

 

amandeep_dhak
Contributor II
Contributor II
Author

Is there a simple example which you don't mind sharing? I don't need the App, I just need the JS.

 

Thanks

Amandeep