<?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 variable in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55609#M774215</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you try just this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Date = p(Months)&amp;gt;}sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2018 14:35:59 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-05-04T14:35:59Z</dc:date>
    <item>
      <title>Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55607#M774213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to store the selected values in a variable, then use the variable in set analysis. &lt;/P&gt;&lt;P&gt;Method 1:&lt;/P&gt;&lt;P&gt;step1: create variable vMonth=GetFieldSelections(Months in List box),&lt;/P&gt;&lt;P&gt;step2: in set analysis expression, I use =sum({&amp;lt;Date={"$(vMonth)"}&amp;gt;}sales);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method 2:&lt;/P&gt;&lt;P&gt;step1: create variable vMonth==concat(distinct (Months in List box), chr(39)&amp;amp;', '&amp;amp;chr(39)),&lt;/P&gt;&lt;P&gt;step2: in set analysis expression, =sum({&amp;lt;Date={'$(vMonth)'}&amp;gt;}sales);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neither of these two methods don't work with variables. If I use GetFieldSelection or Concat directly in set analysis expression , both are working. &lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date={"$(=GetFieldSelections(Months in List box))"}&amp;gt;}sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date={'$(=concat(distinct (Months in List box), chr(39)&amp;amp;', '&amp;amp;chr(39)))'}&amp;gt;}sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if I miss anything, any suggestions? Thx.&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-variable-in-set-analysis/m-p/55607#M774213</guid>
      <dc:creator>yzhang88</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55608#M774214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;did you try&lt;/P&gt;&lt;P&gt;$(=vMonth)&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 14:26:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55608#M774214</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2018-05-04T14:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55609#M774215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you try just this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Date = p(Months)&amp;gt;}sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 14:35:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55609#M774215</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-04T14:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55610#M774216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny. Either GetFieldSelections or Concat expression work, now I am trying to make the variable method working. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 14:40:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55610#M774216</guid>
      <dc:creator>yzhang88</dc:creator>
      <dc:date>2018-05-04T14:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55611#M774217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Robin. I did, but no luck here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 14:43:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55611#M774217</guid>
      <dc:creator>yzhang88</dc:creator>
      <dc:date>2018-05-04T14:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55612#M774218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But p() doesn't work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 14:45:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55612#M774218</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-04T14:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55613#M774219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to use both concat and get field selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because when multiple values are selected values will be displayed like A,B we need make it 'A','B' as the variable result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shan S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 14:54:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55613#M774219</guid>
      <dc:creator>shansundar</dc:creator>
      <dc:date>2018-05-04T14:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55614#M774220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny, I didn't try, it might work. My focus on this question is trying to make the variable method working, not find workaround solution The P() function might work, in my post, using GetFieldSelections or Concat directly in set analysis expression also work. I am new to Qlik and try to learn more stuff during projects. Thx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 15:03:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55614#M774220</guid>
      <dc:creator>yzhang88</dc:creator>
      <dc:date>2018-05-04T15:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55615#M774221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/people/yzhang88"&gt;yzhang88&lt;/A&gt;‌ - you are free to try and learn, but p() is not a work around.... what you are trying is work around and that too longer work around which I would recommend not using over p().... If I were new, I would first learn p() and then go onto learning other ways of doing it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 15:06:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55615#M774221</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-04T15:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55616#M774222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just figure out this issue. I am defining different alternate states in each sheet, so need put state name when creating variables.&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;Method 1:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;step1: create variable vMonth=GetFieldSelections(Months, ',', 100, 'StateName'),&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;step2: in set analysis expression, I use =sum({&amp;lt;Date={"$(vMonth)"}&amp;gt;}sales);&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;Method 2:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;step1: create variable vMonth=concat({[AlternateStateName]}distinct (Months in List box), chr(39)&amp;amp;', '&amp;amp;chr(39)),&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;step2: in set analysis expression, =sum({&amp;lt;Date={'$(vMonth)'}&amp;gt;}sales);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;both &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(vMonth) or &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(=vMonth) working. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks everyone.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 15:27:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55616#M774222</guid>
      <dc:creator>yzhang88</dc:creator>
      <dc:date>2018-05-04T15:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55617#M774223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion. Love this community! My real purpose is passing the selected values from Source A to a dimension in Aggr function for Source B. Is that possible? &lt;/P&gt;&lt;P&gt;Avg(Aggr(sum(sales), Date)).&lt;/P&gt;&lt;P&gt;Can I assign the Date value with variable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 15:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55617#M774223</guid>
      <dc:creator>yzhang88</dc:creator>
      <dc:date>2018-05-04T15:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55618#M774224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure I understand what the real purpose is... would you be able to elaborate a little may be with an example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 15:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55618#M774224</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-04T15:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55619#M774225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, in one sheet, I have data source A with EmployeeName, Date, other HR info, Source B has EmployeeName, Date, Sales Data. Users pick employeeName and date from Source A filter, I want to show mixed results of HR and avg month sale.&amp;nbsp; &lt;/P&gt;&lt;P&gt;These two data sources can only join with Employee Name and date, no other relations, it will cause duplicate records using SQL or Qlik Data model. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 16:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variable-in-set-analysis/m-p/55619#M774225</guid>
      <dc:creator>yzhang88</dc:creator>
      <dc:date>2018-05-04T16:55:51Z</dc:date>
    </item>
  </channel>
</rss>

