<?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 - variable in modifier in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370043#M493537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will sue ur qvw to test easily. I will past the functionnal code here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 May 2012 14:50:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-25T14:50:51Z</dc:date>
    <item>
      <title>Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370039#M493533</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;&lt;/P&gt;&lt;P&gt;hope you can help on this one. I have the following field: YEAR_SELECTION which can get the following values: "financial_year" or "underwriting_year".&lt;/P&gt;&lt;P&gt;Each of the two values corresponds to a field that has been loaded. Based on the YEAR_SELECTION field, I have computed a variable (YEAR) which, based on the active selection in YEAR_SELECTION provides the name of the field that contains the years I want to look at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is to sum revenues for just the max(YEAR).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore what I want is something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({ &amp;lt; YEAR_SELECTION = {$(=max($(YEAR)))} } REVENUES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula works partially. It works if I write:&lt;/P&gt;&lt;P&gt;=sum({ &amp;lt;financial_year = {$(=max($(YEAR)))} } REVENUES) &lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;=sum({ &amp;lt;financial_year = {$(=max($(YEAR)))} } REVENUES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I cannot get the variable YEAR_SELECTION to become the modifier for the set analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one able to solve this? &lt;/P&gt;&lt;P&gt;Suggestions are veery welcomed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 13:45:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370039#M493533</guid>
      <dc:creator />
      <dc:date>2012-05-25T13:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370040#M493534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u join a .qvw to test please ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try =sum({ &amp;lt; $(YEAR_SELECTION) = $(=max($([YEAR]))) &amp;gt; } REVENUES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's look right for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 14:03:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370040#M493534</guid>
      <dc:creator />
      <dc:date>2012-05-25T14:03:50Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370041#M493535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I have tried your solution but it doesen't work. If QV can't recognize the YEAR_SELECTION field then it will sum up everything, disregarding the year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't attach a qvw file since I'm using a personal edition and wouldn't be able to reopen the file again.&lt;/P&gt;&lt;P&gt;Sorry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 14:28:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370041#M493535</guid>
      <dc:creator />
      <dc:date>2012-05-25T14:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370042#M493536</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 am not sure why you want YEAR_SELECTION in the set expression at all. From your description I understood that YEAR_SELECTION is the variable a user selects to choose between underwriting or financial year. When the user makes that selection, the YEAR variable updates to reflect the correct field name. This field contains a value that you want to test against financial_year in the set expression. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I correct so far? Then your set expression appears to work in the way that you want...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So then I am not sure that I understand your problem. Please clarify&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 14:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370042#M493536</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-05-25T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370043#M493537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will sue ur qvw to test easily. I will past the functionnal code here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 14:50:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370043#M493537</guid>
      <dc:creator />
      <dc:date>2012-05-25T14:50:51Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370044#M493538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply. You are partially right:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YEAR_SELECTION is the variable a user selects to choose between underwriting or financial year. When the user makes that selection, the YEAR variable updates to reflect the possible values available for the field selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me make an example, hopefully this can help:&lt;/P&gt;&lt;P&gt;say you selected financial_year in the YEAR_SELECTION field. The field YEAR would return 2011, 2012. This means that the sum of revenues I'm trying to do now would be: &lt;/P&gt;&lt;P&gt;=sum({ &amp;lt;financial_year = {'2012'}&amp;gt;} REVENUES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other example:&lt;/P&gt;&lt;P&gt;say you selected undewriting_year in the YEAR_SELECTION field. The field YEAR would return 2007, 2008, 2009. This means that the sum of revenues I'm trying to do now would be: &lt;/P&gt;&lt;P&gt;=sum({ &amp;lt;undewriting_year = {'2009'}&amp;gt;} REVENUES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is that the formula has to adopt by itself based on the selection done in YEAR_SELECTION and therefore compute the max year available from the possible values of the outcome field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both explenation and solutions are hard. Sorry&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 14:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370044#M493538</guid>
      <dc:creator />
      <dc:date>2012-05-25T14:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370045#M493539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm attaching a little file that hopefully will be helpful.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 15:20:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370045#M493539</guid>
      <dc:creator />
      <dc:date>2012-05-25T15:20:12Z</dc:date>
    </item>
    <item>
      <title>Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370046#M493540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like what you need is an IF statement, really:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if($(YEAR_SELECTION) = 'financial_year',&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;sum({ &amp;lt;financial_year = {$(YEAR)}&amp;gt;} REVENUES),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;sum({ &amp;lt;undewriting_year = {$(YEAR)}&amp;gt;} REVENUES))&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 20:54:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370046#M493540</guid>
      <dc:creator />
      <dc:date>2012-05-25T20:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370047#M493541</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;what's about &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;sum({ &amp;lt; $(YEAR) = {$(=max($(YEAR)))} &amp;gt;} REV)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;But I would suggest either to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;YEAR_SELECTION&lt;/P&gt;&lt;P&gt;FIN_YEAR&lt;/P&gt;&lt;P&gt;UW_YEAR&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;load FIN_YEAR as [Financial Year], UW_YEAR as [Undewriting Year] ...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which will simplify the situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 May 2012 13:43:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370047#M493541</guid>
      <dc:creator>s_uhlig</dc:creator>
      <dc:date>2012-05-26T13:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - variable in modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370048#M493542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all and thanks for your repies. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, the IF statement works but I would need to have a condition for every YEAR_SELECTION I have. I don't really like this solution but can't think of anything better. At the moment this is the best I could get to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Computing" the YEAR_SELECTION inside the set_analysis as the name of the field is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2012 07:01:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-in-modifier/m-p/370048#M493542</guid>
      <dc:creator />
      <dc:date>2012-05-28T07:01:26Z</dc:date>
    </item>
  </channel>
</rss>

