<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to filter a chart using an API? in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-filter-a-chart-using-an-API/m-p/1128987#M5310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The methods are async so you can't rely on app.getObject to finish before you issue your selection.&lt;/P&gt;&lt;P&gt;Luckily all methods in the Capabilities API return a promise so you can establish some kind of flow control,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pseudo code:&lt;/P&gt;&lt;P&gt;app.getObject('mydiv', 'myobjectid').then(() =&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; app.field('myfield').selectMatch('Cubs', false)&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2016 13:10:30 GMT</pubDate>
    <dc:creator>Alexander_Thor</dc:creator>
    <dc:date>2016-07-11T13:10:30Z</dc:date>
    <item>
      <title>How to filter a chart using an API?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-filter-a-chart-using-an-API/m-p/1128986#M5309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a following simple code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var config = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; host: "sense-demo.qlik.com",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix: "/",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; port: 443,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; isSecure: true&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;require.config({&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; baseUrl: (config.isSecure ? "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;" : "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;require(["js/qlik"], function (qlik) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; qlik.setOnError(function (error) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(error.message);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var app = qlik.openApp("d972b07b-fd90-466c-97be-b7aeecca29ee", config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.getObject($("#myDiv"), "cReWKcL");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.field("Team Name").selectMatch("Cubs", false); //Here I'm trying to display a chart only for the Cubs team&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it appears to be non-deterministic. Once I get a one bar (only for the Cubs) and after few reloads I get a chart for all of the teams. And the other way around.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you provide some help regarding how to apply filtering on charts using JS API?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aleksander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 09:34:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-filter-a-chart-using-an-API/m-p/1128986#M5309</guid>
      <dc:creator />
      <dc:date>2016-07-11T09:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a chart using an API?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-filter-a-chart-using-an-API/m-p/1128987#M5310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The methods are async so you can't rely on app.getObject to finish before you issue your selection.&lt;/P&gt;&lt;P&gt;Luckily all methods in the Capabilities API return a promise so you can establish some kind of flow control,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pseudo code:&lt;/P&gt;&lt;P&gt;app.getObject('mydiv', 'myobjectid').then(() =&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; app.field('myfield').selectMatch('Cubs', false)&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 13:10:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-filter-a-chart-using-an-API/m-p/1128987#M5310</guid>
      <dc:creator>Alexander_Thor</dc:creator>
      <dc:date>2016-07-11T13:10:30Z</dc:date>
    </item>
  </channel>
</rss>

