<?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: Set dimension values equal to another field value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271111#M26133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with a table that contains event ticket data and need help with some set analysis. The goal is to create a line chart that has 1 dimension and 2 measures that compares ticket sales over the course of time for an event (event_id) and its predecessor (py_event_id).&amp;nbsp; A selection of the event_id must be made for the chart to work. Since the two sale periods could be differing lengths, I have set the dimension to be the percentage of time in the sale period. The syntax is this: NUM(((sale_date-cy_first_sale_date))/(cy_days_in_sale_period), '#,##0.00%'). cy stands for current year. The measure is Sum(tickets). This works in the line chart. I tried creating the second measure with set analysis like this: Sum({$&amp;lt;event=p(event_id)tickets). However, this just returns the same result as the first measure. I am guessing that the set analysis is not affecting the values in the dimension calculation. Does anyone have any insight on how I can make this work? Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2016 23:10:55 GMT</pubDate>
    <dc:creator>gbarrett</dc:creator>
    <dc:date>2016-11-17T23:10:55Z</dc:date>
    <item>
      <title>Set Analysis: Set dimension values equal to another field value</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271111#M26133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with a table that contains event ticket data and need help with some set analysis. The goal is to create a line chart that has 1 dimension and 2 measures that compares ticket sales over the course of time for an event (event_id) and its predecessor (py_event_id).&amp;nbsp; A selection of the event_id must be made for the chart to work. Since the two sale periods could be differing lengths, I have set the dimension to be the percentage of time in the sale period. The syntax is this: NUM(((sale_date-cy_first_sale_date))/(cy_days_in_sale_period), '#,##0.00%'). cy stands for current year. The measure is Sum(tickets). This works in the line chart. I tried creating the second measure with set analysis like this: Sum({$&amp;lt;event=p(event_id)tickets). However, this just returns the same result as the first measure. I am guessing that the set analysis is not affecting the values in the dimension calculation. Does anyone have any insight on how I can make this work? Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2016 23:10:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271111#M26133</guid>
      <dc:creator>gbarrett</dc:creator>
      <dc:date>2016-11-17T23:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Set dimension values equal to another field value</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271112#M26134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest using this fantastic set analysis expression generator:&lt;/P&gt;&lt;P&gt;&lt;A href="http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa=" title="http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa="&gt;http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa=&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think what you are trying to do will fall under "Indirect Set Analysis".&amp;nbsp; There are examples and you can enter your field names into the wizard and it creates the correct syntax, which can be tricky if you just type it all up. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2016 23:34:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271112#M26134</guid>
      <dc:creator>sarahplymale</dc:creator>
      <dc:date>2016-11-17T23:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Set dimension values equal to another field value</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271113#M26135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi George,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the reason why your second measure is because once you have made a selection in Qlik (for and event [event_id]), the set of data is filtered, therefore you cannot show the previous event id [py_event_id] as it is outside of the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure how your dimension for the sale period links to the event_id so I'm going to assume there is no issue from that perspective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the measures to work, you will need to make your selection on something else than the event_id, like a name [event_name].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will need to create 2 variables&lt;/P&gt;&lt;P&gt;vCurrentID: =Only([event_id]) which returns the event_id from the current [event_name] selection&lt;/P&gt;&lt;P&gt;vPreviousID: =Only([event_id])-1 &lt;/P&gt;&lt;P&gt;Here I am assuming that you can find the previous id of the event by applying some logic...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So measure one, for the current selection would be &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum([tickets]) as the event_id is automatically derived from the selection of event name.&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;&lt;BR /&gt;&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;The measure for the previous event id would be Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$&amp;lt;{[event_name]=,event_id={'$(&lt;SPAN style="font-size: 13.3333px;"&gt;vPreviousID)&lt;/SPAN&gt;'}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[tickets])&lt;/SPAN&gt;&lt;/SPAN&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;The &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[event_name]=, part of the expression exclude this particular selection.&lt;/SPAN&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;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;You might want to have a look at this if you need to exclude all selections...&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;A href="https://help.qlik.com/en-US/sense/1.1/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/SetAnalysis.htm" title="https://help.qlik.com/en-US/sense/1.1/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/SetAnalysis.htm"&gt;https://help.qlik.com/en-US/sense/1.1/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/SetAnalysis.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 02:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271113#M26135</guid>
      <dc:creator>davidpetiot</dc:creator>
      <dc:date>2016-11-18T02:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Set dimension values equal to another field value</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271114#M26136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe this is the case. The 'p' in my set analysis allows for possible values outside of the selection. I tried your method and the measure still wasn't working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe that the set analysis is properly affecting the measure, but not changing the values in the dimension to the possible values. I just don't know how to get that to work. If I could use set analysis throughout the calculated dimension, I feel like that would work. But I don't believe Qlik has the functionality for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 15:34:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Set-dimension-values-equal-to-another-field-value/m-p/1271114#M26136</guid>
      <dc:creator>gbarrett</dc:creator>
      <dc:date>2016-11-18T15:34:41Z</dc:date>
    </item>
  </channel>
</rss>

