<?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 Generic calendar with Set Analysis question in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709613#M54469</link>
    <description>&lt;P&gt;I have created a &lt;STRONG&gt;GENERICcalendar&lt;/STRONG&gt; whose date selections will bring me back results from tables that have no calendar attached. I also have a &lt;STRONG&gt;TransactionsCalendar&lt;/STRONG&gt; that is linked to my Transactions table using the &lt;STRONG&gt;TransactionDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In the "old fashioned way", I would have coded:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;= count(if([DestinationDate] = SelectedDate, ItemID))&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;where: &lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SelectedDate&lt;/EM&gt; is the date on the GENERIC calendar (selected either individually or range)&lt;BR /&gt;&lt;EM&gt;DestinationDate&amp;nbsp;&lt;/EM&gt;is a date on my Transactions table&lt;/P&gt;&lt;P&gt;The problem is that in the above statement my results are affected by selections in the TransactionCalendar that reduce my data set, so SET ANALYSIS is needed.&lt;/P&gt;&lt;DIV class="gmail_default"&gt;&lt;STRONG&gt;count({$&amp;lt;[Transaction Year]=, [Transaction Month]=,[Transaction Day]=,TransactionDate=,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="gmail_default"&gt;&lt;STRONG&gt;ItemID=P({$&amp;lt;[Transaction&amp;nbsp;Year]=, [Transaction Month]=,&lt;/STRONG&gt;&lt;STRONG&gt;[Transaction Day]=,TransactionDate=, &lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="gmail_default"&gt;&lt;STRONG&gt;[DestinationDate]={"=$(=floor(SelectedDate))"}&amp;gt;})&amp;gt;}ItemID)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but get no results - ANY IDEAS WOULD BE WELCOME&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 18:30:49 GMT</pubDate>
    <dc:creator>alexis</dc:creator>
    <dc:date>2024-11-16T18:30:49Z</dc:date>
    <item>
      <title>Generic calendar with Set Analysis question</title>
      <link>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709613#M54469</link>
      <description>&lt;P&gt;I have created a &lt;STRONG&gt;GENERICcalendar&lt;/STRONG&gt; whose date selections will bring me back results from tables that have no calendar attached. I also have a &lt;STRONG&gt;TransactionsCalendar&lt;/STRONG&gt; that is linked to my Transactions table using the &lt;STRONG&gt;TransactionDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In the "old fashioned way", I would have coded:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;= count(if([DestinationDate] = SelectedDate, ItemID))&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;where: &lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SelectedDate&lt;/EM&gt; is the date on the GENERIC calendar (selected either individually or range)&lt;BR /&gt;&lt;EM&gt;DestinationDate&amp;nbsp;&lt;/EM&gt;is a date on my Transactions table&lt;/P&gt;&lt;P&gt;The problem is that in the above statement my results are affected by selections in the TransactionCalendar that reduce my data set, so SET ANALYSIS is needed.&lt;/P&gt;&lt;DIV class="gmail_default"&gt;&lt;STRONG&gt;count({$&amp;lt;[Transaction Year]=, [Transaction Month]=,[Transaction Day]=,TransactionDate=,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="gmail_default"&gt;&lt;STRONG&gt;ItemID=P({$&amp;lt;[Transaction&amp;nbsp;Year]=, [Transaction Month]=,&lt;/STRONG&gt;&lt;STRONG&gt;[Transaction Day]=,TransactionDate=, &lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="gmail_default"&gt;&lt;STRONG&gt;[DestinationDate]={"=$(=floor(SelectedDate))"}&amp;gt;})&amp;gt;}ItemID)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but get no results - ANY IDEAS WOULD BE WELCOME&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:30:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709613#M54469</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2024-11-16T18:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Generic calendar with Set Analysis question</title>
      <link>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709615#M54470</link>
      <description>&lt;P&gt;&lt;STRONG&gt;[DestinationDate]={"=$(=floor(SelectedDate))"}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;the above could work if your destination date is integers, else you have to try to make the format matching while comparing, something like:&lt;/P&gt;&lt;P&gt;[DestinationDate]={"=$(=&lt;STRONG&gt;Date&lt;/STRONG&gt;(SelectedDate, &lt;STRONG&gt;'desiredDateformat'&lt;/STRONG&gt;))"}&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if this doesn't give you the right result, you might have to work on data modelling then.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 06:29:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709615#M54470</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-06-10T06:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generic calendar with Set Analysis question</title>
      <link>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709642#M54476</link>
      <description>&lt;P&gt;Thanks for the reply - ALL dates are integers so it's not a date formatting issues - I was hoping that it would be a Set Analysis issue.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count({$&amp;lt;[Transaction Year]=, [Transaction Month]=,[Transaction Day]=,TransactionDate=,&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;ItemID=P({$&amp;lt;[Transaction Year]=, [Transaction Month]=,&lt;/STRONG&gt;&lt;STRONG&gt;[Transaction Day]=,TransactionDate=,&lt;BR /&gt;[DestinationDate]={"&amp;gt;=$(=floor(min(SelectedDate))) &amp;lt;=$(=floor(max(SelectedDate)))"}&amp;gt;})&amp;gt;}ItemID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;works fine but it assumes contiguous dates. Using the above formula does not account for "gaps" in the dates. For example if I selected 1/4/20, 2/4/20, 4/4/20 the above formula will also add 3/4/20 which was not selected.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 07:39:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709642#M54476</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2020-06-10T07:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Generic calendar with Set Analysis question</title>
      <link>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709680#M54481</link>
      <description>&lt;P&gt;In your expression are 3 different dates but you mention only two calendars and their linked dates - what is the third date - &lt;SPAN&gt;[DestinationDate]&lt;/SPAN&gt; - for a date? If there are only two dates - one related with the facts and one not related (from a loosen table) which is just for selecting the following should work:&lt;/P&gt;&lt;DIV class="gmail_default"&gt;count({$&amp;lt;[Transaction Year]=, [Transaction Month]=,[Transaction Day]=,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TransactionDate= p(SelectedDate)&amp;gt;} ItemID)&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 09:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709680#M54481</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-06-10T09:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Generic calendar with Set Analysis question</title>
      <link>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709954#M54518</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Your answer is very close to the answer that in the end proved easier than I first thought.&lt;BR /&gt;There are indeed 3 dates:&lt;BR /&gt;TransactionDate: This is the date that links the Transactions table with the TransactionCalendar.&amp;nbsp;&lt;BR /&gt;DestinationDate: This is a date in the Transaction table&lt;BR /&gt;SelectedDate: This is the date that is in a Calendar "island" that is not connected with any table but there for the user to select from&lt;/P&gt;&lt;P&gt;The answer is very close to your suggestion but subtly different:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;count({$&amp;lt;[Transaction Year]=, [Transaction Month]=,[Transaction Day]=,&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TransactionDate=, [DestinationDate]= p(SelectedDate)&amp;gt;} ItemID)&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks you Marcus for your input&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 21:43:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generic-calendar-with-Set-Analysis-question/m-p/1709954#M54518</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2020-06-10T21:43:39Z</dc:date>
    </item>
  </channel>
</rss>

