<?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 date between two date fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549457#M39586</link>
    <description>&lt;P&gt;How about this&lt;/P&gt;&lt;PRE&gt;Count(DISTINCT {$&amp;lt;[Candidate Number] = {"=[Last Appears] &amp;gt;= [Extract Date] and [First Appears] &amp;lt;= [Extract Date]"}&amp;gt;} [Candidate Number])&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Feb 2019 20:43:27 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-02-26T20:43:27Z</dc:date>
    <item>
      <title>Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549302#M39566</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I had what I thought was a good idea that does not seem to be working at all.&lt;/P&gt;&lt;P&gt;I have a table of candidates linked to a table containing dates ("extract date"). Candidates have a "first appears" and "last appears" value, both dates. I am creating a line chart showing how many candidates were in the system on any given date. So, extract date is the dimension. I want my set analysis to include a candidate if and only if the (dimensional) extract date falls between the "first appears" and "last appears" date for the candidate.&lt;/P&gt;&lt;P&gt;I've tried the following:&lt;/P&gt;&lt;P&gt;Count(distinct {$&amp;lt;[Last Appears]={"&amp;gt;=$(=Extract Date)"},[First Appears]={"&amp;lt;=$(=Extract Date)"}&amp;gt;} [Candidate Number])&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;candidate line is straight across the whole way, no variation&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Count(distinct {$&amp;lt;[Extract Date]={"&amp;gt;=$(=First Appears)&amp;lt;=$(=Last Appears)"}&amp;gt;} [Candidate Number])&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;same but now it's not reactive to selections on extract date&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any ideas? Thank you!&lt;/P&gt;&lt;P&gt;If relevant, here is the data structure. I have three tables relevant to the calculation:&lt;/P&gt;&lt;P&gt;Right-side table contains position types, business units, and dates (dates are non-unique), and is linked to middle table by a key of position type+subtype&lt;/P&gt;&lt;P&gt;Middle table contains position descriptions and is linked to left-side table by position type&lt;/P&gt;&lt;P&gt;Left-side table contains individual candidate info with a position type. Candidates can apply for multiple positions so candidates are not unique within the table and can be linked to different positions. (not linked by type-subtype because subtype can't be determined based on candidate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549302#M39566</guid>
      <dc:creator>lwestmaas</dc:creator>
      <dc:date>2019-02-26T15:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549310#M39567</link>
      <description>Perhaps this will reserve?&lt;BR /&gt;Count(distinct {$&amp;lt;[Last Appears]={"=[Last Appears]&amp;gt;=[Extract Date]"},[First Appears]={"=[First Appears]&amp;lt;=[Extract Date]"}&amp;gt;} [Candidate Number])</description>
      <pubDate>Tue, 26 Feb 2019 15:20:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549310#M39567</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-02-26T15:20:19Z</dc:date>
    </item>
    <item>
      <title>Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549358#M39571</link>
      <description>Unfortunately that didn't work, appears there's an error in syntax that I can't identify. Tried placing dollar signs and parentheses in a few places but nothing made it display.&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:44:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549358#M39571</guid>
      <dc:creator>lwestmaas</dc:creator>
      <dc:date>2019-02-26T16:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549369#M39573</link>
      <description>&lt;P&gt;Update - that did actually work but ONLY if a single extract date is selected. Otherwise it calculates to 0!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:08:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549369#M39573</guid>
      <dc:creator>lwestmaas</dc:creator>
      <dc:date>2019-02-26T17:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549456#M39585</link>
      <description>&lt;P&gt;What I think is going on here is that this part of your set expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"&amp;gt;=$(=Extract Date)"},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is actually trying to do this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"&amp;gt;=$(=Only([Extract Date])"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Where it is trying to compare the "First Appears" date to the only value of "Extract Date" that is possible.&lt;/P&gt;&lt;P&gt;When you actually select a value for "Extract Date" this "Only" expression works, because there really is only one value.&lt;/P&gt;&lt;P&gt;But, you're thinking, "in the chart there is only one value available, because the measure is being calculated at a particular dimensional value", right?&lt;/P&gt;&lt;P&gt;Well, according to this post, a set expression is evaluated only &lt;STRONG&gt;once per chart&lt;/STRONG&gt;, not for every dimensional value. So, that "Only" expression comes up null.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/Evaluating-quot-sets-quot-in-the-context-of-a-dimension/ta-p/1494598" target="_blank"&gt;https://community.qlik.com/t5/QlikView-Documents/Evaluating-quot-sets-quot-in-the-context-of-a-dimension/ta-p/1494598&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You may be able to fool it with a complicated "Aggr", i.e., create a virtual table that creates a record for each employee per each date, but I'm not sure.&lt;/P&gt;&lt;P&gt;Why not just put your summary metrics in the same table as the "Extract Date". So you'd have for each extract date a # of candidates field?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 20:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549456#M39585</guid>
      <dc:creator>jonvitale</dc:creator>
      <dc:date>2019-02-26T20:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549457#M39586</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;&lt;PRE&gt;Count(DISTINCT {$&amp;lt;[Candidate Number] = {"=[Last Appears] &amp;gt;= [Extract Date] and [First Appears] &amp;lt;= [Extract Date]"}&amp;gt;} [Candidate Number])&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 20:43:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549457#M39586</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-26T20:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549459#M39587</link>
      <description>Pretty sure this won't work, [Last Appears] and [Extract Date] are on two different tables and have no implicit relationship. How would this expression "know" which Extract Date to compare [Last Appears] to?</description>
      <pubDate>Tue, 26 Feb 2019 20:46:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1549459#M39587</guid>
      <dc:creator>jonvitale</dc:creator>
      <dc:date>2019-02-26T20:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with date between two date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1664846#M50019</link>
      <description>&lt;P&gt;I was having similar issues and the following solution worked for me:&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;count({&amp;lt; [Extract Date]={"&amp;gt;=$(First Appears)&amp;lt;=$(Last Appears)"}&amp;gt;}distinct [Candidate Number])&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;My variable contained date value.&amp;nbsp; It was not an expression. &amp;nbsp;&lt;/FONT&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 00:16:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-date-between-two-date-fields/m-p/1664846#M50019</guid>
      <dc:creator>UrsulaWhite</dc:creator>
      <dc:date>2020-01-13T00:16:15Z</dc:date>
    </item>
  </channel>
</rss>

