<?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 Set analysis and variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433390#M798657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;I am trying to calculate market share by date and facility name for my dataset. I utilizing a mix of static and dynamic dimensions. In my dimensions I have eTimeSelection_TopN and facility.name (in that order).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;eTimeSelection_TopN = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;if(max(total if(GetFieldSelections(freq) = 'Year + Quarter',r.idx,yr.idx2)) - if(GetFieldSelections(freq) = 'Year + Quarter',r.idx,yr.idx2) &amp;lt; if(GetFieldSelections(freq) = 'Year + Quarter',8,5),if(GetFieldSelections(freq) = 'Year + Quarter',full.abv,display.txt)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;r.idx and yr.idx2 are integers that indicate date order&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;full.abv and display.txt are the static dimension that are interchanged based on the user's selection in a list box.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;My expression looks like this : sum( &amp;lt;facility.name, $(=eTimeSelection_TopN)&amp;gt; measure) /&amp;nbsp; sum(&amp;lt;$(=eTimeSelection_TopN)&amp;gt; measure).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;Nothing is returned by expression and in the caption title of the straight table it displays "Error: Error in expression". Any thoughts as to what might be going on? If I change the expression to sum(measure) it calculates and displays correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Set analysis and variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433390#M798657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;I am trying to calculate market share by date and facility name for my dataset. I utilizing a mix of static and dynamic dimensions. In my dimensions I have eTimeSelection_TopN and facility.name (in that order).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;eTimeSelection_TopN = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;if(max(total if(GetFieldSelections(freq) = 'Year + Quarter',r.idx,yr.idx2)) - if(GetFieldSelections(freq) = 'Year + Quarter',r.idx,yr.idx2) &amp;lt; if(GetFieldSelections(freq) = 'Year + Quarter',8,5),if(GetFieldSelections(freq) = 'Year + Quarter',full.abv,display.txt)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;r.idx and yr.idx2 are integers that indicate date order&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;full.abv and display.txt are the static dimension that are interchanged based on the user's selection in a list box.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;My expression looks like this : sum( &amp;lt;facility.name, $(=eTimeSelection_TopN)&amp;gt; measure) /&amp;nbsp; sum(&amp;lt;$(=eTimeSelection_TopN)&amp;gt; measure).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;Nothing is returned by expression and in the caption title of the straight table it displays "Error: Error in expression". Any thoughts as to what might be going on? If I change the expression to sum(measure) it calculates and displays correctly.&lt;/SPAN&gt;&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/Set-analysis-and-variables/m-p/1433390#M798657</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433391#M798659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;May be as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;sum( &amp;lt;facility.name, $('eTimeSelection_TopN')&amp;gt; measure) /&amp;nbsp; sum(&amp;lt;$('eTimeSelection_TopN')&amp;gt; measure).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;sum( &amp;lt;facility.name, $(eTimeSelection_TopN)&amp;gt; measure) /&amp;nbsp; sum(&amp;lt;$(eTimeSelection_TopN)&amp;gt; measure).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;sum( &amp;lt;facility.name, '$(eTimeSelection_TopN)'&amp;gt; measure) /&amp;nbsp; sum(&amp;lt;'$(eTimeSelection_TopN)'&amp;gt; measure).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433391#M798659</guid>
      <dc:creator>trdandamudi</dc:creator>
      <dc:date>2017-12-05T18:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433392#M798660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neither worked. I get the same as before. What is the intent of changing the order of the ' ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 19:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433392#M798660</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-05T19:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433393#M798661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may need TOTAL qualifier like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;sum(&lt;SPAN style="color: #ff0000;"&gt;TOTAL&lt;/SPAN&gt; &amp;lt;facility.name, $(=eTimeSelection_TopN)&amp;gt; measure) /&amp;nbsp; sum(&lt;SPAN style="color: #575757;"&gt;TOTAL&lt;/SPAN&gt; &amp;lt;$(=eTimeSelection_TopN)&amp;gt; measure).&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 02:04:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433393#M798661</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-12-06T02:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433394#M798662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add single quotes around the field names. Try exactly what I have mentioned below.&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;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #575757;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Variable name:&lt;/STRONG&gt;&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="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #575757;"&gt;eTimeSelection_TopN &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: #575757; font-size: 10pt; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&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="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #575757;"&gt;&lt;SPAN style="; color: #800000; text-decoration: underline;"&gt;&lt;STRONG&gt;Definition:&lt;/STRONG&gt;&lt;/SPAN&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="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #575757;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit;"&gt;if(max(total if(GetFieldSelections(freq) = 'Year + Quarter',r.idx,yr.idx2)) - if(GetFieldSelections(freq) = 'Year + Quarter',r.idx,yr.idx2) &amp;lt; if(GetFieldSelections(freq) = 'Year + Quarter',8,5),if(GetFieldSelections(freq) = 'Year + Quarter',&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 10pt; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;'full.abv','display.txt'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit;"&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="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #575757;"&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: #575757; font-style: inherit; font-size: 10pt; font-family: inherit; text-decoration: underline; font-weight: inherit;"&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&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: #575757; font-style: inherit; font-size: 10pt; font-family: inherit; text-decoration: underline; font-weight: inherit;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&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="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #575757;"&gt;sum( &amp;lt;facility.name, $(eTimeSelection_TopN)&amp;gt; measure) /&amp;nbsp; sum(&amp;lt;$(eTimeSelection_TopN)&amp;gt; measure)&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="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #575757;"&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: #575757; font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;By the way, I am not sure whether the formula which you showed is correct. There is no else part in your condition. If the calculation is less than, then the below line will be considered and you will see field names. If it's greater than, then you will see only hyphen since you haven't mentioned any else part. Hop you already aware this point.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;if(GetFieldSelections(freq) = 'Year + Quarter',&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;'full.abv','display.txt'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 02:29:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433394#M798662</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2017-12-06T02:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433395#M798663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anil: still same error message.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Tamil : The solution did not work. Changing to single quotes around the fields replaced the contents of the field with field name. The results went from showing "Q2-12-Q1'13" to "display.txt".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe more information would help. Several of my variables are nested.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; set vTopN = if(GetFieldSelections(freq) = 'Year + Quarter',8,5);&lt;BR /&gt; set eTimeField = if(GetFieldSelections(freq) = 'Year + Quarter',full.abv,display.txt);&lt;BR /&gt; set eTimeIndex = if(GetFieldSelections(freq) = 'Year + Quarter',r.idx,yr.idx2); &lt;BR /&gt; set eTimeSelection_TopN = if(max(total $(eTimeIndex)) - $(eTimeIndex) &amp;lt; $(vTopN),$(eTimeField));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field freq is manipulated through the user's selection in a list box. The variable definition that I posted previously gets expanded in the variable overview window after the script is loaded. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 13:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433395#M798663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-06T13:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433396#M798664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late reply. I'm not sure what you want to see there. You want to show field name or value? What I have understood is you wanted to include the dimension names dynamicay based on the user selection. Correct me If I am wrong. I would suggest you to paste all those variables in text boxes and test yourself whether its showing expected result or not. This way you can identify which variable is creating problem. Let us know. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 17:08:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-variables/m-p/1433396#M798664</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2017-12-08T17:08:26Z</dc:date>
    </item>
  </channel>
</rss>

