Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

billgates
Contributor

[qlik sense 3.0] I can't programmatically set selections for field. Please assist...

Hello, I'm new in qlik sense and I'm trying to work with qlik programmatically.

I'm trying to set selections for field with month names (on russian language).

h_1474970773_2794890_d70a3d5f84.png

And i can do it by next code and it works:

-- only 1 value i can select by next command

app.field(fieldName).selectMatch('фев', true);

-- by qElemNumber

app.field(fieldName).select([0,1,2,3]);

But it not appropriate for me for some reasons.

----------

I want to select values by something like next.

app.field(fieldName).selectValues([{qText: 'янв'},{qText: 'фев'}], false, false);

app.field(fieldName).selectValues([{qNum: 1},{qNum: 2}], false, false);

app.field(fieldName).selectValues(['янв', 'фев'], true, true);

But it not works for me.

Please help me with right command.

h_1474971439_3203955_9277a859b2.png

Tags (2)
1 Solution

Accepted Solutions
azb
New Contributor

Re: [qlik sense 3.0] I can't programmatically set selections for field. Please assist...

After Skype conversation we've discovered that issue was in input data, Apllying Trim function in the data load script solved the problem.

4 Replies
azb
New Contributor

Re: [qlik sense 3.0] I can't programmatically set selections for field. Please assist...

After Skype conversation we've discovered that issue was in input data, Apllying Trim function in the data load script solved the problem.

miskin_m
Contributor

Re: [qlik sense 3.0] I can't programmatically set selections for field. Please assist...

Hi,

Just want to know, where all we can write this code and how this is integrated with qlik sense apps.

Thanks

billgates
Contributor

Re: [qlik sense 3.0] I can't programmatically set selections for field. Please assist...

Thanks to Anatoly!

Right syntax is:

  var myApp = qlik.currApp();

  var fieldName = "Месяц";

  myApp.field(fieldName).selectValues([{qText:"янв"},{qText:"фев"},{qText:"мар"},{qText:"апр"}], false, false);

And in the dataload block we made next changes:

LOAD

**

    trim(Месяц) as Месяц,

***

Maybe it will help to someone.

billgates
Contributor

Re: [qlik sense 3.0] I can't programmatically set selections for field. Please assist...