Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Highlighted
Not applicable

selectMatch() for more than one value

Does anyone have experience using the selectMatch() function for selecting more than one value in a Qlik Sense mashup?

I want to select more that one year and I've tired these statements without any luck:

app.field("[Year]").selectMatch("20102011", false);

app.field("[Year]").selectMatch("2010 2011", false);

app.field("[Year]").selectMatch("2010|2011", false);

app.field("[Year]").selectMatch("2010,2011", false);

Thanks in advance.

/Thomas

1 Solution

Accepted Solutions
akl
Honored Contributor

Re: selectMatch() for more than one value

SelectMatch performs a field search so normal search syntax in QS applies. In your case it would look like,

app.field("[Year]").selectMatch("2010 or 2011", false);

But I would recommend that you use app.field.selectValues instead which takes an array of either ElemNumbers or strings. In your case it would be something like,


app.field("[Year]").selectValues([{qText: '2010'}, {qText: '2011'}], true, true);

3 Replies
akl
Honored Contributor

Re: selectMatch() for more than one value

SelectMatch performs a field search so normal search syntax in QS applies. In your case it would look like,

app.field("[Year]").selectMatch("2010 or 2011", false);

But I would recommend that you use app.field.selectValues instead which takes an array of either ElemNumbers or strings. In your case it would be something like,


app.field("[Year]").selectValues([{qText: '2010'}, {qText: '2011'}], true, true);

akl
Honored Contributor

Re: selectMatch() for more than one value

ops the search syntax for selectMatch should probably be more closer to app.field("[Year]").selectMatch("=[Year] = '2010' OR [Year] = '2011'")

Not applicable

Re: selectMatch() for more than one value

Thanks Alexander

I gave up on the SelectMatch and went with the SelectValues instead.

Best regards

Thomas

Community Browser