<?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: Qlik Embedded - Initial Selections issues in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490226#M21446</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/318541"&gt;@Damian-Matthews&lt;/a&gt;&amp;nbsp;, here is something to try.&lt;/P&gt;
&lt;P&gt;In the initialAppState module there is this type:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE tabindex="0"&gt;&lt;CODE&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; FieldSelectionState = {
&lt;/SPAN&gt;    &lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;;
&lt;/SPAN&gt;&lt;SPAN&gt;    state?: &lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;;
&lt;/SPAN&gt;    values?: FieldValue[];
    search?: {
        &lt;SPAN&gt;match&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;;
&lt;/SPAN&gt;    };
};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Notice the search property? Instead of supplying values, use a search attribute and add your query there. so something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;qlik-initial-selections &lt;/SPAN&gt;&lt;SPAN&gt;app-id&lt;/SPAN&gt;&lt;SPAN&gt;="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="Network Name" &lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;="My Random Network"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="EventDateNum" &lt;/SPAN&gt;&lt;SPAN&gt;search&lt;/SPAN&gt;&lt;SPAN&gt;="{match:'\&amp;gt;20241001'}"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  &amp;lt;/qlik-initial-selections&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I think this might work. You may have to play around with the match part. Basically when providing the search part you're invoking this method in qix:&amp;nbsp;&lt;A href="https://qlik.dev/apis/json-rpc/qix/field/#select" target="_blank"&gt;https://qlik.dev/apis/json-rpc/qix/field/#select&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2024 18:55:13 GMT</pubDate>
    <dc:creator>Jeffrey_Goldberg</dc:creator>
    <dc:date>2024-10-31T18:55:13Z</dc:date>
    <item>
      <title>Qlik Embedded - Initial Selections issues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490104#M21442</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm currently exploring the world of Qlik Embedded, and after some trial and error, I've been able to successfully embed my clients App/sheets/objects into a little dummy Angular project.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem I now face however, is attempting to apply a selection, making use of the qlik-initial-selections object. More info can be found on this object here:&amp;nbsp;&lt;A href="https://qlik.dev/examples/qlik-embed-examples/qlik-initial-selections/" target="_blank"&gt;Set analytics selection state on qlik-embed | Qlik Developer Portal&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There are currently 2 issues I currently face.&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Specifying a selection against a date or a numeric field&lt;/LI&gt;
&lt;LI&gt;Specifying a function against a field&amp;nbsp;
&lt;OL&gt;
&lt;LI&gt;ie:&amp;nbsp;&amp;lt;field name="EventDateNum" values="=EventDateNum&amp;gt;'20241001'"&amp;gt;&amp;lt;/field&amp;gt;&lt;/LI&gt;
&lt;LI&gt;ie:&amp;nbsp;&amp;lt;field name="EventDate" values="=num(Date(Floor(EventDate)))&amp;gt;'45207'"&amp;gt;&amp;lt;/field&amp;gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Selections made against text fields work, with static values. No functions can be used in the values property.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example code implemented:&amp;nbsp;&lt;BR /&gt;Note that EventDateNum is the Date field with the dashes removed.&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;BR /&gt;  &lt;SPAN&gt;&amp;lt;qlik-initial-selections &lt;/SPAN&gt;&lt;SPAN&gt;app-id&lt;/SPAN&gt;&lt;SPAN&gt;="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="Network Name" &lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;="My Random Network"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="EventDateNum" &lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;="=EventDateNum&amp;gt;'20241001'"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  &amp;lt;/qlik-initial-selections&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;BR /&gt;  &lt;SPAN&gt;&amp;lt;qlik-embed&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;ui&lt;/SPAN&gt;&lt;SPAN&gt;="analytics/selections"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;app-id&lt;/SPAN&gt;&lt;SPAN&gt;="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"&lt;BR /&gt;&lt;/SPAN&gt;  &lt;SPAN&gt;&amp;gt;&amp;lt;/qlik-embed&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;BR /&gt;  &lt;SPAN&gt;&amp;lt;qlik-embed&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;ui&lt;/SPAN&gt;&lt;SPAN&gt;="analytics/sheet"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;app-id&lt;/SPAN&gt;&lt;SPAN&gt;="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;object-id&lt;/SPAN&gt;&lt;SPAN&gt;="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"&lt;BR /&gt;&lt;/SPAN&gt;  &lt;SPAN&gt;&amp;gt;&amp;lt;/qlik-embed&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks in advance for any suggestions on how to correctly implement an initial selection on numeric fields.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 31 Oct 2024 08:29:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490104#M21442</guid>
      <dc:creator>Damian-Matthews</dc:creator>
      <dc:date>2024-10-31T08:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Embedded - Initial Selections issues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490224#M21445</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/318541"&gt;@Damian-Matthews&lt;/a&gt;&amp;nbsp;, I see what you are trying to do and I'm uncertain if it's possible to perform the operation you are trying to do on a numeric field with initial-selections. I'll have a look and if not possible, I'll add it to the backlog as an enhancement.&lt;/P&gt;
&lt;P&gt;Another way you could do an initial selection, albeit a little more coding, is to use qlik-api to connect to the same session, get a field and make a selection.&lt;/P&gt;
&lt;P&gt;Working on some other tutorials right now, but if you need a code sample I can probably whip one up.&lt;/P&gt;
&lt;P&gt;Thank you for using qlik-embed and qlik-api.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeff G&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 18:38:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490224#M21445</guid>
      <dc:creator>Jeffrey_Goldberg</dc:creator>
      <dc:date>2024-10-31T18:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Embedded - Initial Selections issues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490226#M21446</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/318541"&gt;@Damian-Matthews&lt;/a&gt;&amp;nbsp;, here is something to try.&lt;/P&gt;
&lt;P&gt;In the initialAppState module there is this type:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE tabindex="0"&gt;&lt;CODE&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; FieldSelectionState = {
&lt;/SPAN&gt;    &lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;;
&lt;/SPAN&gt;&lt;SPAN&gt;    state?: &lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;;
&lt;/SPAN&gt;    values?: FieldValue[];
    search?: {
        &lt;SPAN&gt;match&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;;
&lt;/SPAN&gt;    };
};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Notice the search property? Instead of supplying values, use a search attribute and add your query there. so something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;qlik-initial-selections &lt;/SPAN&gt;&lt;SPAN&gt;app-id&lt;/SPAN&gt;&lt;SPAN&gt;="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="Network Name" &lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;="My Random Network"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="EventDateNum" &lt;/SPAN&gt;&lt;SPAN&gt;search&lt;/SPAN&gt;&lt;SPAN&gt;="{match:'\&amp;gt;20241001'}"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  &amp;lt;/qlik-initial-selections&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I think this might work. You may have to play around with the match part. Basically when providing the search part you're invoking this method in qix:&amp;nbsp;&lt;A href="https://qlik.dev/apis/json-rpc/qix/field/#select" target="_blank"&gt;https://qlik.dev/apis/json-rpc/qix/field/#select&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 18:55:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490226#M21446</guid>
      <dc:creator>Jeffrey_Goldberg</dc:creator>
      <dc:date>2024-10-31T18:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Embedded - Initial Selections issues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490327#M21449</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/45015"&gt;@Jeffrey_Goldberg&lt;/a&gt;, thank you very much for reaching out and pointers (in the right direction!)&amp;nbsp;&lt;BR /&gt;With your observation, I actually opened the imported JS file and searched for the initial selection functions, and this is what I found.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a function named&amp;nbsp;fieldElementsToFieldSelections within the embed-web-components folder in the index.js file. This function checks for a few different fields, namely; name, state, values, match.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With your direction, I noted that I'd need to use match in place of search, and then apply the expression required. This now works as expected on all data types, utilizing the standard Qlik operators. IE, * as a wildcard, &amp;gt; as greater than, &amp;lt; as less than, etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An additional note I'd like to add, that I noticed while in the index.js file, is there are additional properties that can be applied to the component being clear-all (boolean that determines if the existing selections should be cleared on re-initialization) and bookmark (bookmark object that contains either a data-id or bookmark-id property with it's value)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The use case I have now implemented:&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;qlik-initial-selections &lt;/SPAN&gt;&lt;SPAN&gt;app-id&lt;/SPAN&gt;&lt;SPAN&gt;="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx" &lt;/SPAN&gt;&lt;SPAN&gt;clear-all&lt;/SPAN&gt;&lt;SPAN&gt;="true"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="Network Name" &lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;="My Random Network"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  &amp;lt;field &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;="Event Date" &lt;/SPAN&gt;&lt;SPAN&gt;match&lt;/SPAN&gt;&lt;SPAN&gt;="&amp;gt;08/01/2023"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;lt;/field&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/qlik-initial-selections&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Nov 2024 11:26:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490327#M21449</guid>
      <dc:creator>Damian-Matthews</dc:creator>
      <dc:date>2024-11-01T11:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Embedded - Initial Selections issues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490348#M21450</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/318541"&gt;@Damian-Matthews&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Great to read you have it working. I acknowledge the feedback. We are constantly striving to improve our documentation and reference.&lt;/P&gt;
&lt;P&gt;So excited to see you using qlik-embed!&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Jeff G&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 14:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Embedded-Initial-Selections-issues/m-p/2490348#M21450</guid>
      <dc:creator>Jeffrey_Goldberg</dc:creator>
      <dc:date>2024-11-01T14:14:36Z</dc:date>
    </item>
  </channel>
</rss>

