Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[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

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

View solution in original post

4 Replies
Anonymous
Not applicable
Author

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

Hi,

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

Thanks

Anonymous
Not applicable
Author

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.