Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

which method can be used for selecting values in multiple dimensions in extensions ???

Hi everyone,

I have been developing qliksense extensions for some time. In one of the extensions its required to select multiple values from multiple dimensions and apply as filters from the chart.

Issue is one dimension values can be filtered using method :

1. self.backendApi.selectValues(dim, [value], true);

or

2. self.selectValues(dim, [value], true);

But is there any method available or any technique that can be used which can apply filters to multiple dimensions at the same time, and then repaint the chart.

Thanks.

4 Replies
Highlighted

Hi Ashish,

You could use the mashup API and the field methods. To do that you need to reference the mashup API in the define at the beginning of the extension:

define(["qlik"], function(qlik) {

....

});

You can then use the mashup API in your code:

var app = qlik.currApp(this);

app.field('LastName').selectValues([{qText:'Obama'},{qText:"Bush"}], true, true);

           

Hope this helps

/Erik

Highlighted
Contributor III
Contributor III

And how i can construct this in JS?

[{qText:'Obama'},{qText:"Bush"}]

Highlighted
Contributor III
Contributor III

I GOT IT!

Follow :

var formatter = new Intl.DateTimeFormat("pt-BR", { month: "short" }),

  month1 = formatter.format(new Date()) ;

  var monthNames = ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'];

  var posicao = monthNames.indexOf(month1);

  var mesesSelecionados = monthNames.slice(posicao, 12);

app1.field('[messtr]').selectValues( mesesSelecionados, true );

I just use a simple array!!!!! and select another dimension.

Highlighted
Contributor III
Contributor III

diogoguilhen,

Super, thankyou

(works perfectly for Single dimension,multiple values passing to selectValues)