<?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: Unable to define a variable in script level in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778085#M717197</link>
    <description>&lt;P&gt;Try it in this way:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;s&lt;/STRONG&gt;&lt;/FONT&gt;et vVariable&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;= date(max(If(if(Instance='XYZ',DATE) &amp;gt; Today()-4, '2000-01-01',if(Instance='XYZ'))),'YYYY-MM-DD');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jan 2021 13:25:23 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2021-01-28T13:25:23Z</dc:date>
    <item>
      <title>Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778021#M717195</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;When i define a variable from application settings -&amp;gt; variable overview and add variable name vVariable and define it as&amp;nbsp;&lt;/P&gt;&lt;P&gt;=date(max(If(if(Instance='XYZ',DATE) &amp;gt; Today()-4, '2000-01-01',if(Instance='XYZ'))),'YYYY-MM-DD')&lt;/P&gt;&lt;P&gt;It returns a date and it is right , but if i define the same variable from the script level as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let vVariable&amp;nbsp;&lt;BR /&gt;=date(max(If(if(Instance='XYZ',DATE) &amp;gt; Today()-4, '2000-01-01',if(Instance='XYZ'))),'YYYY-MM-DD')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it through an error saying syntax error, unexpected token ',' expected nothing , and it shows error for this line.&lt;/P&gt;&lt;P&gt;I want to evaluate the value of the variable thus i put let command instead of set . Set does not through an error but pass a string. i want to evaluate the value.&lt;/P&gt;&lt;P&gt;Any idea why it is giving an error with the let statement in the script please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778021#M717195</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2024-11-15T23:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778085#M717197</link>
      <description>&lt;P&gt;Try it in this way:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;s&lt;/STRONG&gt;&lt;/FONT&gt;et vVariable&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;= date(max(If(if(Instance='XYZ',DATE) &amp;gt; Today()-4, '2000-01-01',if(Instance='XYZ'))),'YYYY-MM-DD');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 13:25:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778085#M717197</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-01-28T13:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778125#M717199</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;Thank you for your response. Actually i want to evaluate the value in hence suing Let instead of Set as i mentioned in my post.&lt;/P&gt;&lt;P&gt;I want to use the same variable in NPrinting that's the reason i need to do with Let otherwise it is taking as string with Set.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 14:54:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778125#M717199</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2021-01-28T14:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778143#M717201</link>
      <description>&lt;P&gt;Not sure what is going on inside your if conditions..&lt;/P&gt;&lt;P&gt;But don't you think you need &lt;STRONG&gt;GROUP BY&lt;/STRONG&gt; and LOAD statement to use Max() aggregate function in Script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 15:25:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778143#M717201</guid>
      <dc:creator>PradeepK</dc:creator>
      <dc:date>2021-01-28T15:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778154#M717202</link>
      <description>&lt;P&gt;Like PradeepK mentioned you will need a load-statement if you want to evaluate any data from tables. After that you could use functions like peek() or fieldvalue() to pick your wanted values from this table and to assign it to a variable.&lt;/P&gt;&lt;P&gt;In your case the efforts for this load seems quite heavy compared to the creation within the UI.&lt;/P&gt;&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 15:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778154#M717202</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-01-28T15:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778319#M717204</link>
      <description>&lt;P&gt;Thank you Pradeep for your suggestion. Will try that way.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 06:09:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778319#M717204</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2021-01-29T06:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778320#M717205</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;Yes , i agree. I will try what Pradeep and you mentioned.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 06:10:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778320#M717205</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2021-01-29T06:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to define a variable in script level</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778322#M717207</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@&lt;A href="https://www.facetimeapp.net/facetime-for-pc/" target="_self"&gt;FaceTime PC&lt;/A&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;When i define a variable from application settings -&amp;gt; variable overview and add variable name vVariable and define it as&amp;nbsp;&lt;/P&gt;&lt;P&gt;=date(max(If(if(Instance='XYZ',DATE) &amp;gt; Today()-4, '2000-01-01',if(Instance='XYZ'))),'YYYY-MM-DD')&lt;/P&gt;&lt;P&gt;It returns a date and it is right , but if i define the same variable from the script level as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let vVariable&amp;nbsp;&lt;BR /&gt;=date(max(If(if(Instance='XYZ',DATE) &amp;gt; Today()-4, '2000-01-01',if(Instance='XYZ'))),'YYYY-MM-DD')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it through an error saying syntax error, unexpected token ',' expected nothing , and it shows error for this line.&lt;/P&gt;&lt;P&gt;I want to evaluate the value of the variable thus i put let command instead of set . Set does not through an error but pass a string. i want to evaluate the value.&lt;/P&gt;&lt;P&gt;Any idea why it is giving an error with the let statement in the script please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you ,&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It appears to be that since my answer has been posted the naming show has gotten more formal. Individuals who instruct, compose books, and so forth talk about&amp;nbsp; Var affirmation, and capacity assertion.&lt;/P&gt;&lt;P&gt;Here is the extra Wikipedia post that underpins my point: Declarations and definitions .and to respond to the primary inquiry. Pronounce variable before your capacity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2021 12:05:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-define-a-variable-in-script-level/m-p/1778322#M717207</guid>
      <dc:creator>Cole_114</dc:creator>
      <dc:date>2021-02-13T12:05:43Z</dc:date>
    </item>
  </channel>
</rss>

