Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlick Sense 3.0 How to programmatically set selections by value?

Hello!

I'm beginner in qlik and I'm trying work with Qlick Sense 3.0 programmatically


I'm working with application described here

I can't programmatically get selections, please assist

This time, i want to set selections for field programmatically.

I can do it by next commands and it works:

app.field('Year').select([0], false, false);

app.field('Year').select([0, 1, 2], true, true);

app.field('Year').selectMatch('1997', true);

app.field('Year').selectAll();

But when I'm trying to select multiple values by value, nothing happening.


my code is:

app.field('Year').selectValues([{qText: '1997'}, {qText: '1998'}, {qText: '1999'}], true, true);


Example I took from this instructions:

https://help.qlik.com/en-US/sense-developer/3.0/Subsystems/APIs/Content/MashupAPI/Methods/selectValu...


PS


When I'm printing field values in console by next code:

$.each(app.field('Year').getData().rows, function(key, value) {

  console.log(value.qText);

});

I'm receiving correct values:

h_1472638260_9659500_2b2fa2a9bf.png

Thanks

Please assist...

1 Solution

Accepted Solutions
Aiham_Azmeh
Employee
Employee

Hi,

My guess will be that those FieldValues have a Numeric representation, while you are sending only qText:

http://help.qlik.com/en-US/sense-developer/3.0/Subsystems/EngineAPI/Content/Classes/FieldClass/Field...

You should check if qNumeric === true and if so send instead qNumber && qNumeric.

View solution in original post

2 Replies
Aiham_Azmeh
Employee
Employee

Hi,

My guess will be that those FieldValues have a Numeric representation, while you are sending only qText:

http://help.qlik.com/en-US/sense-developer/3.0/Subsystems/EngineAPI/Content/Classes/FieldClass/Field...

You should check if qNumeric === true and if so send instead qNumber && qNumeric.

Anonymous
Not applicable
Author

Thanks, Alham!

looks like for my purpose enough and it works:

app.field('Year').selectValues([1997, 1998, 1999, 2000], true, true);