<?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 Use of Variable in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146487#M13099</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I have following Variable in QV document&lt;/P&gt;
&lt;P&gt;vSale=Sum({&amp;lt;Type={'SA'}&amp;gt;}Sales)&lt;/P&gt;
&lt;P&gt;I want to use that variable in the following expression in my&amp;nbsp; Pivot Table&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;PERIODID={"&amp;lt;=$(=Max(PERIODID)-1)"},YEAR =,QUARTER =,MONTH =,PERIOD =&amp;gt;}&lt;STRONG&gt;$(vSale)&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;But When I write the expression it returns Zero Value. Kindly help me to rectify it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 04:58:22 GMT</pubDate>
    <dc:creator>Upali_Wijearatne</dc:creator>
    <dc:date>2023-12-12T04:58:22Z</dc:date>
    <item>
      <title>Use of Variable</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146487#M13099</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I have following Variable in QV document&lt;/P&gt;
&lt;P&gt;vSale=Sum({&amp;lt;Type={'SA'}&amp;gt;}Sales)&lt;/P&gt;
&lt;P&gt;I want to use that variable in the following expression in my&amp;nbsp; Pivot Table&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;PERIODID={"&amp;lt;=$(=Max(PERIODID)-1)"},YEAR =,QUARTER =,MONTH =,PERIOD =&amp;gt;}&lt;STRONG&gt;$(vSale)&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;But When I write the expression it returns Zero Value. Kindly help me to rectify it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 04:58:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146487#M13099</guid>
      <dc:creator>Upali_Wijearatne</dc:creator>
      <dc:date>2023-12-12T04:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Variable</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146499#M13100</link>
      <description>&lt;P&gt;Hi, you can not use Sum function within Sum function, for that you need to use the Aggr function.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/aggr.htm#:~:text=Aggr()%20returns%20an%20array,calculated%20once%20per%20dimensional%20value" target="_blank"&gt;https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/aggr.htm#:~:text=Aggr()%20returns%20an%20array,calculated%20once%20per%20dimensional%20value&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 06:05:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146499#M13100</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2023-12-12T06:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Variable</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146513#M13101</link>
      <description>&lt;P&gt;Try debugging the expression step by step.&lt;/P&gt;
&lt;P&gt;Create a text object for&lt;STRONG&gt; $(vSale)&lt;/STRONG&gt; to ensure that the variable is calculated correctly. Make sure that the field names in the set expressions are correct and exist in your data model.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 06:27:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146513#M13101</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2023-12-12T06:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Variable</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146522#M13102</link>
      <description>&lt;P&gt;Thanks for Your reply. However I am new to qlikview I can not figure out how write my expression' Kindly rewrite the expression to suit my requirement&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 06:32:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146522#M13102</guid>
      <dc:creator>Upali_Wijearatne</dc:creator>
      <dc:date>2023-12-12T06:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Variable</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146535#M13103</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Try like below&lt;/P&gt;
&lt;P&gt;Method 1:&lt;/P&gt;
&lt;P&gt;VariableName:vSale&lt;BR /&gt;Value: Sales [Without equal sign]&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;PERIODID={"&amp;lt;=$(=Max(PERIODID)-1)"},YEAR =,QUARTER =,MONTH =,PERIOD =, &lt;SPAN&gt;Type={'SA'}&lt;/SPAN&gt;&amp;gt;}&lt;STRONG&gt;$(vSale)&lt;/STRONG&gt;)&lt;BR /&gt;&lt;BR /&gt;or&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;VariableName: vTypeSA&lt;BR /&gt;Value:&amp;nbsp;Type={'SA'}&amp;nbsp;[Without equal sign]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;PERIODID={"&amp;lt;=$(=Max(PERIODID)-1)"},YEAR =,QUARTER =,MONTH =,PERIOD =,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;$(vTypeSA)&lt;/SPAN&gt;&amp;gt;}&lt;SPAN&gt;Sales&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;Both will work. If you want to use like ur variable, you need to use like blelow&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;PERIODID={"&amp;lt;=$(=Max(PERIODID)-1)"},YEAR =,QUARTER =,MONTH =,PERIOD =,&amp;nbsp;Type={'SA'}&amp;gt;} Aggr(&lt;/SPAN&gt;&lt;STRONG&gt;$(vSale), urdimension)&lt;/STRONG&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;However, i think, its not optimistic.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 07:06:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-of-Variable/m-p/2146535#M13103</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2023-12-12T07:06:18Z</dc:date>
    </item>
  </channel>
</rss>

