<?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: Numbers of Days in selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201484#M625702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Maybe This for Calendar Days&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Num(Max(Datefield)-Min(Datefield))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Oct 2016 20:39:21 GMT</pubDate>
    <dc:creator>rupamjyotidas</dc:creator>
    <dc:date>2016-10-17T20:39:21Z</dc:date>
    <item>
      <title>Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201482#M625700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How calculate the number of calendar days in the period selections, regardless of the selections on the tables?&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 19:33:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201482#M625700</guid>
      <dc:creator>george_1955</dc:creator>
      <dc:date>2016-10-17T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201483#M625701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you elaborate on your requirement with an example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:07:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201483#M625701</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-17T20:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201484#M625702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Maybe This for Calendar Days&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Num(Max(Datefield)-Min(Datefield))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201484#M625702</guid>
      <dc:creator>rupamjyotidas</dc:creator>
      <dc:date>2016-10-17T20:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201485#M625703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interval (Timestamp#(TimeEnd,'DD/MM/YYYY hh:mm:ss') - Timestamp#(TimeEnd,'DD/MM/YYYY&lt;/P&gt;&lt;P&gt;hh:mm:ss'), 'hh:mm:ss')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201485#M625703</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-17T20:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201486#M625704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing you mean the total number of calendar days in the data model, ignoring all selections, and calculated in script since this is in the scripting section?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Days]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD max([Date]) - min([Date]) as [Days In Data Model]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD num(fieldvalue('Date',recno())) as [Date]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE fieldvaluecount('Date')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I probably wouldn't bother with script. I'd use the below expression, possibly as a result stored in a variable if I was using it in several places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;max({1} Date) - min({1} Date)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:53:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201486#M625704</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-10-17T20:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201487#M625705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for the reply.&lt;/P&gt;&lt;P&gt;Perhaps my question was not clear, and rephrase again:&lt;/P&gt;&lt;P&gt;I want to calculate the number of calendar days (in UI) corresponding selections of time (ex. Jan-april and year=2016),regardless of other selections they make (eg. Product, channel)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 04:51:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201487#M625705</guid>
      <dc:creator>george_1955</dc:creator>
      <dc:date>2016-10-18T04:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201488#M625706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(&lt;SPAN style="font-size: 13.3333px;"&gt;{1&amp;lt;Month = p(Month), Year = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;p(Year)&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;, Date = P(Date), Quarter = P(Quarter), MonthYear = p(MonthYear)&amp;gt;}&lt;/SPAN&gt;Date) - Min({1&amp;lt;Month = p(Month), Year = &lt;SPAN style="font-size: 13.3333px;"&gt;p(Year)&lt;/SPAN&gt;, Date = P(Date), Quarter = P(Quarter), MonthYear = p(MonthYear)&amp;gt;}Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201488#M625706</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-18T15:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201489#M625707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Max(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;{1&amp;lt;Month = $::Month, Year = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;, Date = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;Date, Quarter = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;Quarter, MonthYear = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;MonthYear&amp;gt;}&lt;/SPAN&gt;Date) - Min(&lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;{1&amp;lt;Month = $::Month, Year = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;, Date = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;Date, Quarter = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;Quarter, MonthYear = &lt;STRONG style="font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;$::&lt;/STRONG&gt;MonthYear&amp;gt;}&lt;/SPAN&gt;&lt;/STRONG&gt;Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:49:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201489#M625707</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-18T15:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201490#M625708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do we need the p() for anything other than [Date]? All the other fields should have a direct effect on what values of [Date] are possible, and so I think selections in them would indirectly count. I may be missing something but it seems to be working on a simple example I'm fiddling with. So might this do the trick?&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;max({1&amp;lt;[Date]=p([Date])&amp;gt;} [Date]) - &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;min({1&amp;lt;[Date]=p([Date])&amp;gt;} [Date])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 22:00:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201490#M625708</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-10-18T22:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201491#M625709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wait, since other selections affect what is possible, neither approach works. I think we have to explicitly tell it which fields to ignore, not which ones to use. So... dollar sign expansion with a funky concat(). Hmmm... something like this, assuming all these fields are on a calendar connected only by Date to the rest of the model?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;max({&amp;lt;[$(=concat({&amp;lt;[$Table]-={'Calendar'},[$Field]-={'Date'}&amp;gt;} distinct [$Field],']=,['))]=}&amp;gt;} [Date]) - min({&amp;lt;[$(=concat({&amp;lt;[$Table]-={'Calendar'},[$Field]-={'Date'}&amp;gt;} distinct [$Field],']=,['))]=}&amp;gt;} [Date])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find an app with a calendar and see...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Yeah, that seems to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 22:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201491#M625709</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-10-18T22:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201492#M625710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why would this not work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-size: 13px; font-family: inherit; color: #3d3d3d;"&gt;Max(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;{1&amp;lt;Month = $::Month, Year = &lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;, Date = &lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;Date, Quarter = &lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;Quarter, MonthYear =&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;MonthYear&amp;gt;}&lt;/SPAN&gt;Date) - Min(&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;{1&amp;lt;Month = $::Month, Year = &lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;, Date = &lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;Date, Quarter =&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;Quarter, MonthYear = &lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$::&lt;/STRONG&gt;MonthYear&amp;gt;}&lt;/SPAN&gt;&lt;/STRONG&gt;Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 22:42:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201492#M625710</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-18T22:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Numbers of Days in selection</title>
      <link>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201493#M625711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, yeah, that should work. Or because I'm crazy and have to make things more complicated in the name of making them simpler:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;max({1&amp;lt;[$(=concat({&amp;lt;[$Table]={'Calendar'}&amp;gt;} distinct [$Field]&amp;amp;']=$::['&amp;amp;[$Field],'],['))]&amp;gt;} [Date]) - m&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;in({1&amp;lt;[$(=concat({&amp;lt;[$Table]={'Calendar'}&amp;gt;} distinct [$Field]&amp;amp;']=$::['&amp;amp;[$Field],'],['))]&amp;gt;} [Date])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 22:54:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Numbers-of-Days-in-selection/m-p/1201493#M625711</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-10-18T22:54:25Z</dc:date>
    </item>
  </channel>
</rss>

