Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
And how i can construct this in JS?
[{qText:'Obama'},{qText:"Bush"}]
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.
diogoguilhen,
Super, thankyou
(works perfectly for Single dimension,multiple values passing to selectValues)