<?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: Variable with parameter not working in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-with-parameter-not-working-in-expression/m-p/1387829#M810926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might explain the magic of the leading equal sign:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3406"&gt;The Magic of Variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe try (without the leading equal sign variable definition)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=1-(Sum({1&amp;lt;Month ={&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;"$(=$(vTest3(0)))"&lt;/STRONG&gt;}&amp;gt;} Breaches))&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;/Sum({1&amp;lt;CalMonthYear2={'Oct-17'}&amp;gt;} Pathways)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Oct 2017 19:26:37 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2017-10-03T19:26:37Z</dc:date>
    <item>
      <title>Variable with parameter not working in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-with-parameter-not-working-in-expression/m-p/1387828#M810925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Qlikers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A newbie here trying to figure out why this simple statement wont work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=1-(Sum({1&amp;lt;Month ={&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;'Oct-17'&lt;/STRONG&gt;&lt;/SPAN&gt;}&amp;gt;} Breaches))&lt;/P&gt;&lt;P&gt;/Sum({1&amp;lt;CalMonthYear2={'Oct-17'}&amp;gt;} Pathways)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Then in same expression I put a simple variable which is:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;vTest = Oct-17 &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;like so;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;=1-(Sum({1&amp;lt;Month ={&lt;STRONG&gt;"$(vTest)"&lt;/STRONG&gt;}&amp;gt;} Breaches))&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;/Sum({1&amp;lt;CalMonthYear2={'Oct-17'}&amp;gt;} Pathways)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also works great&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Then in same expression I put a slightly more complex variable which is:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;vTest2&amp;nbsp; = &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;Text(Month(Today())) &amp;amp; '-' &amp;amp; Text(right(Year(Today()),2))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(which outputs the same figure 'Oct-17' and works fine called from a text box) but in the expression&lt;/P&gt;&lt;P&gt;like so;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=1-(Sum({1&amp;lt;Month ={&lt;STRONG&gt;"$(vTest2)"&lt;/STRONG&gt;}&amp;gt;} Breaches))&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;/Sum({1&amp;lt;CalMonthYear2={'Oct-17'}&amp;gt;} Pathways)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this only works if '=' is placed in front of formula in Variable Overview. Anyway it works so thats fine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;However I then have an even more complex function or 'parameter' variable which outputs exactly the same figure of 'Oct-17':&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vTest3 =&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if($1=0, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Text(Month(Today())) &amp;amp; '-' &amp;amp; Text(right(Year(Today()),2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Text(Month(addMonths(Today(),$1))) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp; '-' &amp;amp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;num(Month(addMonths(Today(),$1)),'00') &amp;lt;4,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Text(right(Year(addYears(Today(),1)),2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Text(right(Year(Today()),2))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;works great in a normal text box but in the above expression i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=1-(Sum({1&amp;lt;Month ={&lt;STRONG&gt;"$(vTest3(0))"&lt;/STRONG&gt;}&amp;gt;} Breaches))&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;/Sum({1&amp;lt;CalMonthYear2={'Oct-17'}&amp;gt;} Pathways)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this also refuses to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please help me as I'm pulling out my hair. I'm a sql guy and this is a little weird for me lol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help in anticipation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-with-parameter-not-working-in-expression/m-p/1387828#M810925</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable with parameter not working in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-with-parameter-not-working-in-expression/m-p/1387829#M810926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might explain the magic of the leading equal sign:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3406"&gt;The Magic of Variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe try (without the leading equal sign variable definition)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=1-(Sum({1&amp;lt;Month ={&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;"$(=$(vTest3(0)))"&lt;/STRONG&gt;}&amp;gt;} Breaches))&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;/Sum({1&amp;lt;CalMonthYear2={'Oct-17'}&amp;gt;} Pathways)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Oct 2017 19:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-with-parameter-not-working-in-expression/m-p/1387829#M810926</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-10-03T19:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variable with parameter not working in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-with-parameter-not-working-in-expression/m-p/1387830#M810927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As usual you are a genius. I had an extra '=' at the beginning of the formula in the Variable Overview where I assigned the formula, and that stopped it from working. Yes I re-read your post telling me to rid the equals sign there too duh. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 09:43:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-with-parameter-not-working-in-expression/m-p/1387830#M810927</guid>
      <dc:creator />
      <dc:date>2017-10-04T09:43:01Z</dc:date>
    </item>
  </channel>
</rss>

