<?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: Using variables in chart expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374078#M808974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have .. both of them are not null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Oct 2017 15:19:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-16T15:19:47Z</dc:date>
    <item>
      <title>Using variables in chart expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374076#M808972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I defined the following variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier;"&gt;- vPraticheCaricateMeseCorr = count({&amp;lt; FlagCaricatoLiquidato={'Caricato'}, AnnoMese = {$(=$(vMaxAnnoMese))}&amp;gt;} distinct ContrattoID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000;"&gt;- vPraticheCaricateMesePrec = &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 13.3333px; font-family: 'courier new', courier;"&gt;count({&amp;lt; FlagCaricatoLiquidato={'Caricato'}, AnnoMese = {$(=$(vMaxAnnoMesePrec))}&amp;gt;} distinct ContrattoID)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I used the variables in a chart expression as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;($(vPCaricateMeseCorr)-$(vPCaricateMesePrec))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;($(vPCaricateMesePrec))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chart is a pivot table with one dimension and multiple expressions besides the one I have shared with you.&lt;/P&gt;&lt;P&gt;Every works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I change the variables definition as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;- vPraticheCaricateMeseCorr = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;if(GetSelectedCount(AnnoMese)&amp;gt;0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;count({&amp;lt; FlagCaricatoLiquidato={'Caricato'}, AnnoMese = P(AnnoMese)&amp;gt;} distinct ContrattoID),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;count({&amp;lt; FlagCaricatoLiquidato={'Caricato'}, AnnoMese = {"$(=Max(AnnoMese))"}&amp;gt;} distinct ContrattoID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;- vPraticheCaricateMesePrec =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;if(GetSelectedCount(AnnoMese)&amp;gt;1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;null(),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;count({&amp;lt; FlagCaricatoLiquidato={'Caricato'}, AnnoMese = {$(=$(vMaxAnnoMesePrec))}&amp;gt;} distinct ContrattoID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression in the chart stops working and shows '-' for all rows.&lt;/P&gt;&lt;P&gt;I think there is a problem with the dollar sign expansion but I am not able to solve it. So far I have tried to add brackets like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;(&lt;SPAN style="color: #ff0000;"&gt;(&lt;/SPAN&gt;$(vPCaricateMeseCorr)&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;-&lt;SPAN style="color: #ff0000;"&gt;(&lt;/SPAN&gt;$(vPCaricateMesePrec)&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;($(vPCaricateMesePrec))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;which does not work and also&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;($(=$(vPCaricateMeseCorr)-)$(=$(vPCaricateMesePrec)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;($(=$(vPCaricateMesePrec)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;but the last attempt is showing the total in all rows of the table, which happen even if I add the "=" sign in front of the variable definition.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Any suggestion?&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks in advance,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Stefania&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/Using-variables-in-chart-expression/m-p/1374076#M808972</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in chart expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374077#M808973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you put your 2 expressions into a text box to see their values? I'm guessing one of them is null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 15:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374077#M808973</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2017-10-16T15:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in chart expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374078#M808974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have .. both of them are not null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 15:19:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374078#M808974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-16T15:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in chart expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374079#M808975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you using &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;if(GetSelectedCount(AnnoMese)&amp;gt;0&lt;/SPAN&gt; in the first expression and &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;if(GetSelectedCount(AnnoMese)&amp;gt;0&lt;/SPAN&gt; in the second expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would help if you could post a small example qvw file that demonstrates the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 17:30:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374079#M808975</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2017-10-16T17:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using variables in chart expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374080#M808976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;may be change this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;- vPraticheCaricateMesePrec =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;if(GetSelectedCount(AnnoMese)&amp;gt;1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;count({&amp;lt; FlagCaricatoLiquidato={'Caricato'}, AnnoMese = {$(=$(vMaxAnnoMesePrec))}&amp;gt;} distinct ContrattoID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:23:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-in-chart-expression/m-p/1374080#M808976</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2017-10-16T20:23:34Z</dc:date>
    </item>
  </channel>
</rss>

