<?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 Help with variable in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414183#M1164970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to create a variable in the script from another variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first i create this ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vCurrentYearFiscalStartDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = '=DATE(FirstDayCurrentFiscalYear)'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i want to create another variable using the above variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vItemCount_Listings&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;BR /&gt;'COUNT({$&amp;lt;&lt;BR /&gt;[it_target_type]={"Listings"},&lt;BR /&gt;[ld_Dist]={"4"},&lt;BR /&gt;[ld_Outlet_Check_Date]={"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=$(vCurrentYearFiscalStartDate)"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;[ld_Item_Description])'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;The above didnt work, so after a bit of research i tried the following which also didnt work. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vItemCount_Listings&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;BR /&gt;'COUNT({$&amp;lt;&lt;BR /&gt;[it_target_type]={"Listings"},&lt;BR /&gt;[ld_Dist]={"4"},&lt;BR /&gt;[ld_Outlet_Check_Date]={"&amp;gt;='&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;chr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(36)&amp;amp;'(=vCurrentYearFiscalStartDate)"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;[ld_Item_Description])';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Does anyone have any ideas please?&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Oct 2012 10:08:28 GMT</pubDate>
    <dc:creator>hopkinsc</dc:creator>
    <dc:date>2012-10-15T10:08:28Z</dc:date>
    <item>
      <title>Help with variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414183#M1164970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to create a variable in the script from another variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first i create this ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vCurrentYearFiscalStartDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = '=DATE(FirstDayCurrentFiscalYear)'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i want to create another variable using the above variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vItemCount_Listings&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;BR /&gt;'COUNT({$&amp;lt;&lt;BR /&gt;[it_target_type]={"Listings"},&lt;BR /&gt;[ld_Dist]={"4"},&lt;BR /&gt;[ld_Outlet_Check_Date]={"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=$(vCurrentYearFiscalStartDate)"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;[ld_Item_Description])'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;The above didnt work, so after a bit of research i tried the following which also didnt work. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vItemCount_Listings&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;BR /&gt;'COUNT({$&amp;lt;&lt;BR /&gt;[it_target_type]={"Listings"},&lt;BR /&gt;[ld_Dist]={"4"},&lt;BR /&gt;[ld_Outlet_Check_Date]={"&amp;gt;='&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;chr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(36)&amp;amp;'(=vCurrentYearFiscalStartDate)"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;[ld_Item_Description])';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Does anyone have any ideas please?&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:08:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414183#M1164970</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-10-15T10:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414184#M1164971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vItemCount_Listings =&lt;/P&gt;&lt;P&gt;'COUNT({$&amp;lt;&lt;/P&gt;&lt;P&gt;[it_target_type]={"Listings"},&lt;/P&gt;&lt;P&gt;[ld_Dist]={"4"},&lt;/P&gt;&lt;P&gt;[ld_Outlet_Check_Date]={"&amp;gt;='&amp;amp;chr(36)&amp;amp;'($(vCurrentYearFiscalStartDate))"}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;[ld_Item_Description])';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:16:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414184#M1164971</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-15T10:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414185#M1164972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that brings back a zero value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i change it to use a date instead of variable then i get a value of 139. &lt;/P&gt;&lt;P&gt;LET&lt;/P&gt;&lt;P&gt;vItemCount_Listings =&lt;/P&gt;&lt;P&gt;'COUNT({$&amp;lt;&lt;/P&gt;&lt;P&gt;[it_target_type]={"Listings"},&lt;/P&gt;&lt;P&gt;[ld_Dist]={"4"},&lt;/P&gt;&lt;P&gt;[ld_Outlet_Check_Date]={"&amp;gt;=01/07/2012 00:00:00"}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;[ld_Item_Description])';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i want this to work using a variable instead of hardcoding the date/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414185#M1164972</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-10-15T10:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414186#M1164973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I run the script, I get this variable definition back:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;COUNT({$&amp;lt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[it_target_type]={"Listings"},&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[ld_Dist]={"4"},&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[ld_Outlet_Check_Date]={"&amp;gt;=$(=DATE(FirstDayCurrentFiscalYear))"}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[ld_Item_Description])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is what you intend to get back, right?&lt;/P&gt;&lt;P&gt;If you say, you get a value of 139 back (resp. zero), I assume you mean you get this returned when using the variable in an e.g. text box expression, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can imagine some issues with the set modifier format, 01/07/2012 00:00:00 is a timestamp format, while your standard DATE format is probably missing the time string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414186#M1164973</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-15T10:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414187#M1164974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;Yes you arfe exactly right. I am getting the 139 in a text box using the variable name. what would be the easiest way of getting around the timestamp issues. we dont have the option to remove the time as this is needed. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:44:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414187#M1164974</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-10-15T10:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414188#M1164975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just match the format of your initial variable with the field format, maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vCurrentYearFiscalStartDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = '=Timestamp(FirstDayCurrentFiscalYear,'DD/MM/YYYY hh:mm:ss')'; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:48:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414188#M1164975</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-15T10:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414189#M1164976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got it working by just using the Timestamp function. I had script errors when i used the ,'DD/MM/YYYY hh:mm:ss' at the end. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 11:17:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-variable-in-script/m-p/414189#M1164976</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2012-10-15T11:17:01Z</dc:date>
    </item>
  </channel>
</rss>

