<?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: Set analysis, with if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886147#M653868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the selection is actually in another field (eg Month or Year), then you will need something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(GetPossibleCount(date_of_headcount) &amp;lt; FieldValueCount(date_of_headcount),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum(FTE),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;Headcount_Current_Flag={'Y'}&amp;gt;} FTE)&lt;/P&gt;&lt;P&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;If(GetPossibleCount(date_of_headcount) &amp;lt; FieldValueCount(date_of_headcount),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;Headcount_Current_Flag&amp;gt;} FTE),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;Headcount_Current_Flag={'Y'}&amp;gt;} FTE)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2015 09:24:47 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2015-07-06T09:24:47Z</dc:date>
    <item>
      <title>Set analysis, with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886144#M653865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a a pie chart that shows how many FTE are split between Frontline &amp;amp; Support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data is imported each month, and I have a flag which identifies if the month is the latest month. I have created a set analysis for this (Below):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(Sum({&amp;lt;Headcount_Current_Flag={'Y'}&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;gt;} FTE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I update the set analysis that will only use the flag if no 'date_of_headcount' selections have been made, but uses the 'date_of_headcount' selection if a 'date' has been selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 09:08:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886144#M653865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-06T09:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis, with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886145#M653866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;EDITED : after Jonathan's reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&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;If(GetSelectedCount(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_of_headcount&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;) &amp;gt; 0, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Headcount_Current_Flag&lt;/SPAN&gt;={'Y'}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} FTE), Sum(FTE))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 09:17:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886145#M653866</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-07-06T09:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis, with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886146#M653867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer to use a simple Max(Month_sequence) type of function - this will get the latest loaded if nothing is selected and the selection when something is selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your case, use the flag conditionally, you could do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(GetSelectedCount(date_of_headcount) &amp;gt; 0, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum(FTE),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;Headcount_Current_Flag={'Y'}&amp;gt;} FTE)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work ONLY for selections in &lt;SPAN style="font-size: 13.3333330154419px;"&gt;date_of_headcount. Selections in related date fields will not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 09:20:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886146#M653867</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-07-06T09:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis, with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886147#M653868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the selection is actually in another field (eg Month or Year), then you will need something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(GetPossibleCount(date_of_headcount) &amp;lt; FieldValueCount(date_of_headcount),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum(FTE),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;Headcount_Current_Flag={'Y'}&amp;gt;} FTE)&lt;/P&gt;&lt;P&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;If(GetPossibleCount(date_of_headcount) &amp;lt; FieldValueCount(date_of_headcount),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;Headcount_Current_Flag&amp;gt;} FTE),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({&amp;lt;Headcount_Current_Flag={'Y'}&amp;gt;} FTE)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 09:24:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-if-statement/m-p/886147#M653868</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-07-06T09:24:47Z</dc:date>
    </item>
  </channel>
</rss>

