<?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: count of  no dates fall under week to week in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1994770#M82343</link>
    <description>&lt;P&gt;Create a bridge table so that both date fields are associated to the same calendar&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Maintable:
Load
Keyfield
,dim1
,dim2
,measure1
,measure2
,created_Date
,closure_Date
From Xyzdataset;

Bridge:
Load 
Keyfield
,created_Date as Date
,'created_date' as Datetype
Resident Maintable;
Concatenate(Bridge)
Load 
Keyfield
,closure_Date as Date
,'closure_date' as Datetype
Resident Maintable;

//MasterCalendar should link to Date field in Bridge table which has both closure and created dates now
MasterCalendar:
//add full calendar script here
AUTOGENERATE FieldValueCount('Date');

rfer below
https://qlikviewcookbook.com/2015/05/better-calendar-scripts/&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now your expressions will be as below&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count of Created&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=count({&amp;lt;Datetype={'created_date'}&amp;gt;} Dim1)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count of Closed&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=count({&amp;lt;Datetype={'closed_date'}&amp;gt;} Dim1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 03:48:53 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2022-10-20T03:48:53Z</dc:date>
    <item>
      <title>count of  no dates fall under week to week</title>
      <link>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1994424#M82314</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;I am new to qlik,&lt;/P&gt;
&lt;P&gt;I have a requirement where I need to build the Pivot table&amp;nbsp;&lt;BR /&gt;I have fields - CreatedDate, ClosureDate,&lt;BR /&gt;CreatedDate is connected to Master Calendar&lt;BR /&gt;Dimensions - week start - Master calendar Field week start,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; week end - Master Calendar Field Week End,&lt;BR /&gt;Measures - Open - count of records when , CreatedDate field dates falls between WeekStart and Weekend&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Closed - Count of Records when, ClosureDate Field Dates Falls between WeekStart and Weekend &amp;nbsp; &amp;nbsp;&lt;BR /&gt;I tried logic aggr(Count(CreatedDate),WeekStart) for Open Measure &amp;nbsp; &amp;nbsp;&lt;BR /&gt;but for Closed aggr(count(ClosureDate),WeekStart) this logic is not working.&lt;BR /&gt;Can someone help me on this ,&lt;/P&gt;
&lt;P&gt;Thanks in Advance. &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 12:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1994424#M82314</guid>
      <dc:creator>Prasad1318</dc:creator>
      <dc:date>2022-10-19T12:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: count of  no dates fall under week to week</title>
      <link>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1994462#M82319</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;&lt;BR /&gt;Does your close Date have also his own master calendar?&lt;/P&gt;
&lt;P&gt;because if want to use your field from the Master calendar assign to the Created it's not going to work for Closed, because one date we say is banana and another is apple, if try to make banana split with apple is not going to work.&lt;/P&gt;
&lt;P&gt;You need create a master calendar for the Closed date too and use field from master calendar to the closed date then it will work.&lt;/P&gt;
&lt;P&gt;Also, i could suggest you something like this, to not use aggr a simple flag in your script can make you user a set analysis because it will perform better than aggr.&lt;/P&gt;
&lt;P&gt;In your script add this in your master calendar:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt;// In Master Calendar of Open&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;If(weekday(&lt;SPAN&gt;CreatedDate) &amp;gt; 4 , 1,0) As Created_WeekEnd_flag&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt;// In Master Calendar of Closed&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt;If(weekday(Closed&amp;nbsp;) &amp;gt; 4 , 1,0) As Closed_WeekEnd_flag&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt;Then your expression will be&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt; &amp;nbsp;Count(&amp;nbsp; {&amp;lt; Created_WeekEnd_flag= {1} &amp;gt;}| CreatedDate) //Getting only Weekend Records&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt;Count(&amp;nbsp; {&amp;lt; Created_WeekEnd_flag = {0} &amp;gt;}| CreatedDate) //Getting only working days Records&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt;&amp;nbsp;Count(&amp;nbsp; {&amp;lt; Closed_WeekEnd_flag= {1} &amp;gt;}| ClosureDate) //Getting only Weekend Records&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="syntax" data-mc-conditions="Targets.NotToTranslate"&gt;&lt;SPAN class="script_token"&gt;&lt;SPAN&gt;Count(&amp;nbsp; {&amp;lt; Closed_WeekEnd_flag= {0} &amp;gt;}| ClosureDate) //Getting only working days Records&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:17:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1994462#M82319</guid>
      <dc:creator>ThiagoCN</dc:creator>
      <dc:date>2022-10-19T13:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: count of  no dates fall under week to week</title>
      <link>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1994770#M82343</link>
      <description>&lt;P&gt;Create a bridge table so that both date fields are associated to the same calendar&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Maintable:
Load
Keyfield
,dim1
,dim2
,measure1
,measure2
,created_Date
,closure_Date
From Xyzdataset;

Bridge:
Load 
Keyfield
,created_Date as Date
,'created_date' as Datetype
Resident Maintable;
Concatenate(Bridge)
Load 
Keyfield
,closure_Date as Date
,'closure_date' as Datetype
Resident Maintable;

//MasterCalendar should link to Date field in Bridge table which has both closure and created dates now
MasterCalendar:
//add full calendar script here
AUTOGENERATE FieldValueCount('Date');

rfer below
https://qlikviewcookbook.com/2015/05/better-calendar-scripts/&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now your expressions will be as below&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count of Created&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=count({&amp;lt;Datetype={'created_date'}&amp;gt;} Dim1)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count of Closed&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=count({&amp;lt;Datetype={'closed_date'}&amp;gt;} Dim1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 03:48:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1994770#M82343</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-10-20T03:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: count of  no dates fall under week to week</title>
      <link>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1998597#M82703</link>
      <description>&lt;P&gt;Apologies for late reply&lt;/P&gt;
&lt;P&gt;Thank you for the solution Vinieme12&lt;/P&gt;
&lt;P&gt;Got some additional problem &amp;nbsp;like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now week, count of created ,count of closed are columns in a table. I need to add one more column with calculation as follows&lt;/P&gt;
&lt;P&gt;W1 = count of created-count of closed as (result1)&lt;/P&gt;
&lt;P&gt;W2 = result1+count of created -count of closed as(result2)&lt;/P&gt;
&lt;P&gt;W3 = result2+count of created-count of closed as(result3) and so on…&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Please help me on this.&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 12:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/count-of-no-dates-fall-under-week-to-week/m-p/1998597#M82703</guid>
      <dc:creator>Prasad1318</dc:creator>
      <dc:date>2022-10-31T12:38:16Z</dc:date>
    </item>
  </channel>
</rss>

