<?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: Set analysis as variable in Load statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1978400#M1220879</link>
    <description>&lt;P&gt;Here is the problem. This is what is stored in the variables:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lisa_P_0-1662597837203.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88590i1B10BAF5B6F55C73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lisa_P_0-1662597837203.png" alt="Lisa_P_0-1662597837203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Sep 2022 00:44:12 GMT</pubDate>
    <dc:creator>Lisa_P</dc:creator>
    <dc:date>2022-09-08T00:44:12Z</dc:date>
    <item>
      <title>Set analysis as variable in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1978179#M1220876</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like advice on Set analysis and variable in Load statement. I searched the community for a similar problem, but I couldn't find anything that would help me.&lt;/P&gt;
&lt;P&gt;The idea is that I would like to insert the string (Set analysis) into a variable in the Load statement and then use it in an expression (for example a pivot table). In the attached QV example I put it in a Text object for the simplicity now.&lt;/P&gt;
&lt;P&gt;However, calculating "set analysis = &amp;gt; count DATE lines per YEAR does not work for me:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=count({$&amp;lt;DATE={"$(=Date(MakeDate(GetFieldSelections(YEAR),1,1),'D.M.YYYY'))"}&amp;gt;} YEAR)&lt;/P&gt;
&lt;P&gt;a simple line with the constant: year = 2023 looks like this:&lt;/P&gt;
&lt;P&gt;= count({$&amp;lt;DATE={2023}&amp;gt;} YEAR)&lt;/P&gt;
&lt;P&gt;I think there is a problem with the GetItemSelections() when I SET it in the variable.&lt;BR /&gt;The resulting value is 0 and the result should be equal to 3 for year 2023.&lt;BR /&gt;I checked whether the same Set analysis entry works correctly, but by writing it directly (without a variable) into the text object as an expression - it works fine there, the result is correct = 3 for year 2023 (2&amp;nbsp;for year 2022, 1&amp;nbsp;for year 2021)&lt;/P&gt;
&lt;P&gt;Please advise me how to write correctly the variable in the load statement?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PeterHCM_1-1662562012305.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88520i16CFE35E646EF7E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="PeterHCM_1-1662562012305.png" alt="PeterHCM_1-1662562012305.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PeterHCM_0-1662561359497.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88519i7C939D16EA851EDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="PeterHCM_0-1662561359497.png" alt="PeterHCM_0-1662561359497.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 14:49:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1978179#M1220876</guid>
      <dc:creator>PeterHCM</dc:creator>
      <dc:date>2022-09-07T14:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis as variable in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1978400#M1220879</link>
      <description>&lt;P&gt;Here is the problem. This is what is stored in the variables:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lisa_P_0-1662597837203.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88590i1B10BAF5B6F55C73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lisa_P_0-1662597837203.png" alt="Lisa_P_0-1662597837203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 00:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1978400#M1220879</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2022-09-08T00:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis as variable in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1978498#M1220886</link>
      <description>&lt;P&gt;Thanks Lisa for your reply,&lt;BR /&gt;yes, you're right - that's a problem in the variable where the date function is defined = Date(MakeDate(GetFieldSelections(YEAR),1,1),'D.M.YYYY')&lt;/P&gt;
&lt;P&gt;the variable that gets into the expression is = count({$&amp;lt;DATE={""}&amp;gt;} YEAR)&lt;BR /&gt;where I would like the date (defined formula) to be written there instead of ""&lt;/P&gt;
&lt;P&gt;Please, does anyone know a trick how to write this variable correctly?&lt;BR /&gt;I spend a lot of time testing but still no solution &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 07:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1978498#M1220886</guid>
      <dc:creator>PeterHCM</dc:creator>
      <dc:date>2022-09-08T07:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis as variable in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1979597#M1220952</link>
      <description>&lt;P&gt;I found a link to another article that has a workaround by loading from an excel file ..&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/Managing-Variables/ta-p/1495738" target="_blank"&gt;https://community.qlik.com/t5/QlikView-Documents/Managing-Variables/ta-p/1495738&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 01:20:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1979597#M1220952</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2022-09-12T01:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis as variable in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1980237#M1220969</link>
      <description>&lt;P&gt;Thank you Lisa,&amp;nbsp;very good suggestion to solve my problem...&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 08:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-as-variable-in-Load-statement/m-p/1980237#M1220969</guid>
      <dc:creator>PeterHCM</dc:creator>
      <dc:date>2022-09-13T08:53:27Z</dc:date>
    </item>
  </channel>
</rss>

