<?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 How do you include a date range in a data island? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077663#M359424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a data island to define: Day, Week, Month and use a list box set to the data island to toggle my graphs and text objects to change based on what has been selected. Currently I am able to include a specific date in the script, but I can't quite figure out how to include a date range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My declaration of the data island is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1460043900647811 jive_text_macro" jivemacro_uid="_1460043900647811" modifiedtitle="true"&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %Metric, Exp&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Day,&amp;nbsp;&amp;nbsp; Date(Today()-1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Week,&amp;nbsp; Date(Today()-7)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Month, Date(Today()-30)&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Exp column is used in text objects to change the outputs. An example of one of them is:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14600439979664576" jivemacro_uid="_14600439979664576"&gt;
&lt;P&gt;=count(DISTINCT{$&amp;lt;CreatedOn = {"$(=$(=Exp))"}&amp;gt;}SessionID) &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;This counts the distinct number of SessionIDs and outputs the number in the text object. And this is where I am having problems getting the range to work, because with charts and graphs I just check conditional and re-write the expression based on whats selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried declaring the Exp a few different ways: &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1460044236455173 jive_text_macro" jivemacro_uid="_1460044236455173" modifiedtitle="true"&gt;
&lt;P&gt;Month, CreatedOn={"&amp;lt;=$(=Date(Today()))&amp;gt;=$(=Date(Today()-7))"} &lt;/P&gt;
&lt;P&gt;Month, {"&amp;lt;=$(=Date(Today()))&amp;gt;=$(=Date(Today()-7))"}&lt;/P&gt;
&lt;P&gt;Month,&amp;lt;=$(=Date(Today()))&amp;gt;=$(=Date(Today()-7))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one of these is the correct way, then the problem I am having is calling it in the text object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I am clear enough in what I am asking. If there is something that might need rewording, let me know and I will do my best to clear it up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Apr 2016 15:54:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-04-07T15:54:23Z</dc:date>
    <item>
      <title>How do you include a date range in a data island?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077663#M359424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a data island to define: Day, Week, Month and use a list box set to the data island to toggle my graphs and text objects to change based on what has been selected. Currently I am able to include a specific date in the script, but I can't quite figure out how to include a date range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My declaration of the data island is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1460043900647811 jive_text_macro" jivemacro_uid="_1460043900647811" modifiedtitle="true"&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %Metric, Exp&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Day,&amp;nbsp;&amp;nbsp; Date(Today()-1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Week,&amp;nbsp; Date(Today()-7)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Month, Date(Today()-30)&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Exp column is used in text objects to change the outputs. An example of one of them is:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14600439979664576" jivemacro_uid="_14600439979664576"&gt;
&lt;P&gt;=count(DISTINCT{$&amp;lt;CreatedOn = {"$(=$(=Exp))"}&amp;gt;}SessionID) &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;This counts the distinct number of SessionIDs and outputs the number in the text object. And this is where I am having problems getting the range to work, because with charts and graphs I just check conditional and re-write the expression based on whats selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried declaring the Exp a few different ways: &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1460044236455173 jive_text_macro" jivemacro_uid="_1460044236455173" modifiedtitle="true"&gt;
&lt;P&gt;Month, CreatedOn={"&amp;lt;=$(=Date(Today()))&amp;gt;=$(=Date(Today()-7))"} &lt;/P&gt;
&lt;P&gt;Month, {"&amp;lt;=$(=Date(Today()))&amp;gt;=$(=Date(Today()-7))"}&lt;/P&gt;
&lt;P&gt;Month,&amp;lt;=$(=Date(Today()))&amp;gt;=$(=Date(Today()-7))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one of these is the correct way, then the problem I am having is calling it in the text object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I am clear enough in what I am asking. If there is something that might need rewording, let me know and I will do my best to clear it up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 15:54:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077663#M359424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-07T15:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include a date range in a data island?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077664#M359425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try '&amp;gt;=' &amp;amp; Date(Today()-7) &amp;amp; '&amp;lt;=' &amp;amp; Date(Today)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 08:30:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077664#M359425</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-04-08T08:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include a date range in a data island?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077665#M359426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume a problem could be the dollar sign expansions alread getting expanded (to NULL) in your script execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check after reload, if the Exp field actually shows the correct strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, I think the easiest way would be to load the table from an excel file, not from an INLINE table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 08:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077665#M359426</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-08T08:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include a date range in a data island?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077666#M359427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another option using the INLINE table uses Replace():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD %Metric, Replace(Exp,'@','$') as Exp INLINE [&lt;/P&gt;&lt;P&gt;%Metric, Exp&lt;/P&gt;&lt;P&gt;Month, CreatedOn={"&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7))"}&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Month, {"&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7))"}&amp;nbsp; &lt;/P&gt;&lt;P&gt;Month,&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7))&amp;nbsp; &lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 08:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077666#M359427</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-08T08:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include a date range in a data island?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077667#M359428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And just for clarification, you should use only a single Exp per distinct %Metric value, so this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;LOAD %Metric, Replace(Exp,'@','$') as Exp INLINE [&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;%Metric, Exp&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Month, CreatedOn={"&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7))"}&amp;nbsp; &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Month, {"&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7))"} &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Month,&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7)) &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;];&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;won't work in your application, you need distinct %Metric values&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;LOAD %Metric, Replace(Exp,'@','$') as Exp INLINE [&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;%Metric, Exp&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Month1, CreatedOn={"&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7))"}&amp;nbsp; &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Month2, {"&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7))"} &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Month3,&amp;lt;=@(=Date(Today()))&amp;gt;=@(=Date(Today()-7)) &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I assume you've just posted three alternatives for the same final Month line?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one should work with your original Count() expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Month, &amp;gt;=@(=Date(Today()-7))&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;lt;=@(=Date(Today()))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 09:07:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077667#M359428</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-08T09:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include a date range in a data island?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077668#M359429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This formatting worked immediately when I put it into my script. Thank you for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 12:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077668#M359429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T12:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include a date range in a data island?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077669#M359430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome. Glad you got it sorted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 12:59:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-include-a-date-range-in-a-data-island/m-p/1077669#M359430</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-04-08T12:59:01Z</dc:date>
    </item>
  </channel>
</rss>

