<?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: Concat and GetFieldSelections to use in Set Analysis? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46726#M7792</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;I tried some more ways of referring to the variable and removing the double quotes worked!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Calendar Month] = {$(vCurrentSelectedMonth)},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using that worked!!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Krishna and Rob!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.s. I use the document analyzer nearly every week. I'm a fan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Mar 2018 17:59:24 GMT</pubDate>
    <dc:creator>dena_reavis</dc:creator>
    <dc:date>2018-03-05T17:59:24Z</dc:date>
    <item>
      <title>Concat and GetFieldSelections to use in Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46722#M7788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help getting this to work. (Or if you have a better suggestion! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a variable for the current month where I need to assume a selection if there are none, or take the latest month selected if a user has several months selected...&lt;/P&gt;&lt;P&gt;vCurrentSelectedMonth = &lt;SPAN style="font-size: 13.3333px;"&gt;if(GetSelectedCount([Calendar Month]) =0, VCurrentCloseMonth, MaxString([Calendar Month]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;This was working fine, but my requirement has changed and now I need to show more than one month totals instead of the latest selected month total. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;By the way, VCurrentCloseMonth= a single value calculated during load script, makes it easy to refer to the current closing month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have Jan and Feb selected in [Calendar Month], I wanted the set analysis below to evaluate to be&lt;/P&gt;&lt;P&gt;[Calendar Month] = {'JAN','FEB'}, (or whatever the user selected)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I was trying to use concat and getfieldselections, but my result is missing the inside single quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount([Calendar Month]) =0, VCurrentCloseMonth,&lt;/P&gt;&lt;P&gt;chr(39)&amp;amp;concat(distinct GetFieldSelections([Calendar Month]), chr(39) &amp;amp; chr(44) &amp;amp; chr(39)) &amp;amp; chr(39))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping the result would be 'JAN','FEB' but the result is 'JAN,FEB' without inside quotes and does not work in the set analysis below... so I have something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it matter that [Calendar Month] field is a dual value field? It has number values so I can sort it in the proper order as needed. Also, I am using 12.10 SR 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is where I am using this variable:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[Calendar Month] = {"$(vCurrentSelectedMonth)"},&lt;/P&gt;&lt;P&gt;[Fiscal Year Nbr] = {"$(vCurrentSelectedFY)"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;$(v_Amount))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Mar 2018 20:31:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46722#M7788</guid>
      <dc:creator>dena_reavis</dc:creator>
      <dc:date>2018-03-04T20:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Concat and GetFieldSelections to use in Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46723#M7789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=concat( distinct chr(39) &amp;amp; Date ,chr(39) &amp;amp;',') &amp;amp; chr(39)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;IMG alt="1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/195268_1.PNG" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vCurrentSelectedMonth &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(GetSelectedCount([Calendar Month]) =0, VCurrentCloseMonth, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concat( distinct chr(39) &amp;amp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Calendar Month]&lt;/SPAN&gt;,chr(39) &amp;amp;',') &amp;amp; chr(39) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Mar 2018 23:10:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46723#M7789</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2018-03-04T23:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Concat and GetFieldSelections to use in Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46724#M7790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why use set analysis at all? If you want the data associated with the user selections, you can use the default behavior of the product. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum($(vAmount)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will sum the currently selected data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 02:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46724#M7790</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-03-05T02:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Concat and GetFieldSelections to use in Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46725#M7791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Krishna Nagulapally, thank you! I plugged that in and the variable now shows the right text&lt;/P&gt;&lt;P&gt;This is the variable definition for &lt;STRONG&gt;vCurrentSelectedMonth &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount([Calendar Month]) =0, VCurrentCloseMonth, concat( distinct chr(39) &amp;amp; [Calendar Month],chr(39) &amp;amp;',',[Calendar Month]) &amp;amp; chr(39))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it returns this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'JAN','FEB'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my set expression doesn't calculate when two months are selected.&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; It does work when only one month is selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is an example&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum({&amp;lt;[Calendar Month] = &lt;STRONG&gt;{"$(vCurrentSelectedMonth)"},&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Fiscal Year Nbr] = {"$(vCurrentSelectedFY)"},&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Event = {'Actuals'},&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Currency,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Forecast Type]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(v_Amount))&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&gt;Rob Wunderlich, you're right, I was just showing a simplified version of the expression. Above, I used an example that is a little more like the real thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, now my question is, is the multiple month syntax wrong? I had assumed it would have to be just as if I had hard-coded it to two months in the set analysis. Is it how I reference the variable? &lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;"$(vCurrentSelectedMonth)"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Thank you, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;All help is appreciated!&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 17:03:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46725#M7791</guid>
      <dc:creator>dena_reavis</dc:creator>
      <dc:date>2018-03-05T17:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Concat and GetFieldSelections to use in Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46726#M7792</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;I tried some more ways of referring to the variable and removing the double quotes worked!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Calendar Month] = {$(vCurrentSelectedMonth)},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using that worked!!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Krishna and Rob!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.s. I use the document analyzer nearly every week. I'm a fan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 17:59:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concat-and-GetFieldSelections-to-use-in-Set-Analysis/m-p/46726#M7792</guid>
      <dc:creator>dena_reavis</dc:creator>
      <dc:date>2018-03-05T17:59:24Z</dc:date>
    </item>
  </channel>
</rss>

