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: 
bryan_sng
Partner - Creator
Partner - Creator

Qlik sense extension load data without dimension

Hello guys,

Is there any way I can access data from the app data model without using dimensions?

I understand I can access data via layout.qHyperCube.qDataPages[0] if I add the necessary dimensions in.

I also tried initialproperties such as the following but could not find it anywhere in the layout variable.

define([], function () {

  return {

    version: 1.0,

    qHyperCubeDef: {

      qDimensions: ['mytestproperty1', 'mytestproperty2'],

      qMeasures: [],

      qInterColumnSortOrder: [],

      qInitialDataFetch: [{

        qWidth: 3,

        qHeight: 400

      }]

    }

  };

});

Do you guys have any advice? Thanks!

35 Replies
bryan_sng
Partner - Creator
Partner - Creator
Author

Hmm I have been doing some testing and realise the following:

Suppose I have an empty extension with only a paint method.

    paint: function($element, layout) {

       console.log(qlik.currApp());

    }

Then I create a sheet with that extension and run it.

The app start off with 0 selection.

I use the search function from the selection bar and do any searching (e.g. Country = USA)

It will show "Country: USA" at the selection bar.

Qlik selection bar now has 1 history item which is correct.

Now I execute the following snippet at the console window after registering qlik.currApp() as temp1.

var sttate = '1234567890';

temp1.addAlternateState(sttate).then(function() {

  temp1.field('Country', sttate).clear();

  temp1.field('Country', sttate).selectValues(['Australia'], true, true);

});


The selection history at qlik selection bar become 3!

I'm assuming clear and selectValues are contributing to the selection history although they are at an alternate state.


Now when I try to do a back to previous selection action, those 2 extra history items are duplicating the initial selection (Country: USA).


Current selection: Country: USA

1st click on previous: Country: USA

2nd click on previous: Country: USA

3rd click on previous: No selections applied


Any ideas how to prevent alternate state from recording history?


ErikWetterberg

Yes, you are right, there is only one stack for back/forward, so selections in alternate state will affect this stack. As far as I know there is nothing you can do about it.

Erik

bryan_sng
Partner - Creator
Partner - Creator
Author

Erm... that doesn't sound like good news because my extension is stuck with the current selection permanently.

Reason is because whenever user click previous, the selection at selection bar trigger a paint event which cause my extension to get data for other dimension via createCube in an alternate state. The getting data part will add the selection history.

This result in a clicking previous, adding history item, clicking more previous, adding more history item... loop.

Hmm, not sure whether you have seen my alternative at qlik.openApp and qlik.close

I was aiming to open an application in a separate context.

Meaning to be able to do selectValues, getting data from there via createCube and cleanup via close without affecting the current app.

All I really need is openApp to open in a different context.

ErikWetterberg

Yes, I can see your problem. You might do back() programatically to solve this, but I wouldn't really recommend it, might cause other problems (and forward would be messed up).

Yes, I have seen the other thread and realized that both might be about the same case, but I'll try to discuss that solution there.

Øystein_Kolsrud
Employee
Employee

The getTableDate method is just intended for accessing the raw data. If you are looking for Qlik Sense to provide features beyond that, then hypercubes or list objects are definitely what you should be looking at.

bryan_sng
Partner - Creator
Partner - Creator
Author

Yeah, that's where createCube come in and in order to have additional filters beyond the current selection, alternate state + selectValues looks like the only way to go for now but it's having previous selection issue.

OpenApp method to open the same application using another identity just for the sake of getting data is unfortunately not working or that solution would be ample enough.

Kind of stuck for now