<?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: Field API - Selecting dates with selectValues() not working in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-Selecting-dates-with-selectValues-not-working/m-p/4752#M68</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the help topic on this function there is a note saying: &lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; background-color: #f4f4f4;"&gt;For a numeric field you need to provide the numeric value. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates are numeric in qlik so when using selectValues on date fields, you must use the numeric equivalent of the dates. i.e. to set the date filter to 11/09/1980, the function must be called with &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;app.field(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue;"&gt;'Date'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;).selectValues([29475&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;], &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #006699;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jan 2018 22:54:54 GMT</pubDate>
    <dc:creator>theglenndavid</dc:creator>
    <dc:date>2018-01-22T22:54:54Z</dc:date>
    <item>
      <title>Field API - Selecting dates with selectValues() not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-Selecting-dates-with-selectValues-not-working/m-p/4751#M67</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to call the Field API in my mashup in order to select a range of dates. I am trying to use &lt;A href="http://help.qlik.com/en-US/sense-developer/3.1/Subsystems/EngineAPI/Content/Classes/FieldClass/Field-class-SelectValues-method.htm?&amp;amp;_ga=2.226813533.1368082868.1516623404-151141795.1516623404#FieldValuehttp://"&gt;selectValues() method&lt;/A&gt;. Everything is set up but the last step which communicates with the Qlik Sense API seems not to be working for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I first doubted about the date format not being the correct one with my data model; both of them have the 'mm/dd/yyyy' date format. As suggested&lt;A _jive_internal="true" href="https://community.qlik.com/thread/212797"&gt; in this thread&lt;/A&gt;, I also tried the qNumber value type without any success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below how other Field API methods still work with my 'Date' dimension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_151663071236052" jivemacro_uid="_151663071236052" modifiedtitle="true"&gt;
&lt;P&gt;app.field('Date').selectMatch('01/10/2018', true);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Working&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;app.field('Date').selectValues('01/10/2018', true);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Not working&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif;"&gt;app.field('Date').selectValues(['01/10/2018'], true);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Not working&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif;"&gt;app.field('Date').selectValues([{qText: '01/10/2018'}], true); // Not working&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif;"&gt;app.field('Date').selectValues([{qText: "01/10/2018"}], true); // Not working&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif;"&gt;app.field('Date').selectValues([{qNumber: 01/10/2018}], true); // Not working&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;app.field('Week Number').selectValues([2], true);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Working&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is that selectMatch() works with my date value as string format, but selectValues() does not? Can anyone give me some insights on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;X.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 14:35:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-Selecting-dates-with-selectValues-not-working/m-p/4751#M67</guid>
      <dc:creator>jasonmomoa</dc:creator>
      <dc:date>2018-01-22T14:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Field API - Selecting dates with selectValues() not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-Selecting-dates-with-selectValues-not-working/m-p/4752#M68</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the help topic on this function there is a note saying: &lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; background-color: #f4f4f4;"&gt;For a numeric field you need to provide the numeric value. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates are numeric in qlik so when using selectValues on date fields, you must use the numeric equivalent of the dates. i.e. to set the date filter to 11/09/1980, the function must be called with &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;app.field(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue;"&gt;'Date'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;).selectValues([29475&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;], &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #006699;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 22:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-Selecting-dates-with-selectValues-not-working/m-p/4752#M68</guid>
      <dc:creator>theglenndavid</dc:creator>
      <dc:date>2018-01-22T22:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Field API - Selecting dates with selectValues() not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-Selecting-dates-with-selectValues-not-working/m-p/4753#M69</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, first of all thank you for your prompt reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the &lt;A href="http://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/date-time-functions.htm"&gt;Qlik's Date and Time documentation&lt;/A&gt;, I spotted the baseline &lt;/P&gt;&lt;P&gt;"Functions are based on a date-time serial number that equals the number of days since &lt;SPAN style="text-decoration: underline;"&gt;December 30, 1899.&lt;/SPAN&gt; The integer value represents the day and the fractional value represents the time of the day."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to create the conversion from a selected date in my frontend to a numeric value based on Qlik's conversion. Now the call to app.field('Date').selectValues([qlikNumDate], true); works like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help. Correct answer!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 08:58:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-Selecting-dates-with-selectValues-not-working/m-p/4753#M69</guid>
      <dc:creator>jasonmomoa</dc:creator>
      <dc:date>2018-01-23T08:58:19Z</dc:date>
    </item>
  </channel>
</rss>

