<?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: week wise bucket in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1755398#M720247</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62259"&gt;@pk&lt;/a&gt;&amp;nbsp; try below. Assuming that you have Date field in your Data&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Data:
LOAD ..
...,
dual ( text(weekstart(Date,0,0)) &amp;amp; '-'&amp;amp; text(weekend(Date,0,0)), weekstart(Date,0,0)) as Week_Bucket
FROM Table;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create pivot table and add&amp;nbsp;Week_Bucket as column. Then use below expression&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;= if( weekday(Week_Bucket)='Mon', YourExpression,0)&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 23 Oct 2020 12:21:19 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2020-10-23T12:21:19Z</dc:date>
    <item>
      <title>week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1755328#M720246</link>
      <description>&lt;P&gt;Hi, I'm new to Qlikview and I need help in creating week buckets-&lt;/P&gt;&lt;P&gt;1) if i select September&amp;nbsp;month in filter then my buckets will be like below-&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Transactions from 01/09/20&lt;BR /&gt;to&lt;BR /&gt;06/09/20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Transactions from 07/09/20&lt;BR /&gt;to&lt;BR /&gt;13/09/20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Transactions from 14/09/20&lt;BR /&gt;to&lt;BR /&gt;20/09/20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Transactions from 21/09/20&lt;BR /&gt;to&lt;BR /&gt;27/09/20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Transactions from 28/09/20&lt;BR /&gt;to&lt;BR /&gt;30/09/20&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Cust1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;60.91&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;26.4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;17.72&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Cust2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;560.68&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;567.23&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;514.09&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;520&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Note-&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;This week will not show sum of amt bcz&amp;nbsp; don’t have Monday in it&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Sum of 01/09/20 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;to &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;07/09/20&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Sum of 07/09/20 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;to &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;14/09/20&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Sum of 14/09/20 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;to &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;21/09/20&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Sum of 21/09/20 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;to &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;28/09/20&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;2)if my month start on Tuesday(01/09/20) then my first week will be&amp;nbsp;01/09/20 to 06/09/20 but here i do not want to show any amt&lt;/P&gt;&lt;P&gt;because this week does not consist Monday in it. so its amt will display in next week in&amp;nbsp;07/09/20 to 13/09/20&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:55:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1755328#M720246</guid>
      <dc:creator>pk</dc:creator>
      <dc:date>2024-11-16T17:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1755398#M720247</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62259"&gt;@pk&lt;/a&gt;&amp;nbsp; try below. Assuming that you have Date field in your Data&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Data:
LOAD ..
...,
dual ( text(weekstart(Date,0,0)) &amp;amp; '-'&amp;amp; text(weekend(Date,0,0)), weekstart(Date,0,0)) as Week_Bucket
FROM Table;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create pivot table and add&amp;nbsp;Week_Bucket as column. Then use below expression&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;= if( weekday(Week_Bucket)='Mon', YourExpression,0)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Oct 2020 12:21:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1755398#M720247</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-23T12:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1755872#M720248</link>
      <description>&lt;P&gt;thanks for the immediate solution&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;i need more help in below scenario,&lt;BR /&gt;am showing report by customers, so some of customer's payment cycle is fixed like cust1 payment cycle is on every month's 25 day so my bucket will be same as week but sum(data) will display in 4th week that is 21Sept to 27Sept bucket for Sept month.(sum of 26Aug to 25th Sept Data) so please help to achieve this.&lt;/P&gt;&lt;P&gt;in One/single expression want to achieve this both scenario.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 12:24:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1755872#M720248</guid>
      <dc:creator>pk</dc:creator>
      <dc:date>2020-10-26T12:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1756152#M720249</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;can you please help me in this req&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 09:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1756152#M720249</guid>
      <dc:creator>pk</dc:creator>
      <dc:date>2020-10-27T09:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1756172#M720250</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62259"&gt;@pk&lt;/a&gt;&amp;nbsp; please share sample data with expected output&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 10:36:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1756172#M720250</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-27T10:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1756531#M720251</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;please check i have shared expected format and data&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 07:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1756531#M720251</guid>
      <dc:creator>pk</dc:creator>
      <dc:date>2020-10-28T07:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1758606#M720252</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;Data attached to the thread, sorry the notifications are still not working!&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62259"&gt;@pk&lt;/a&gt;&amp;nbsp;Something else that might work might be intervalMatch, but I am not sure, so attaching some items on that, so you can check them out while Kush is trying to have a look at things.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/IntervalMatch/ba-p/1464547" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/IntervalMatch/ba-p/1464547&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/IntervalMatch.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/IntervalMatch.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 19:14:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1758606#M720252</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-11-04T19:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1758667#M720253</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62259"&gt;@pk&lt;/a&gt;&amp;nbsp; expected output is bit different than your actual qvw file data. not sure how expected output is calculated&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 22:00:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1758667#M720253</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-11-04T22:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: week wise bucket</title>
      <link>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1758719#M720254</link>
      <description>&lt;P&gt;i got interested bec your 2nd week starts with the last day of your prior week and so on.&amp;nbsp; there may be a way to do that but i would move that logic to the script for faster rendering:&lt;/P&gt;&lt;P&gt;Dates:&lt;BR /&gt;load date(date('1/1/2020') + RowNo()-1) as Date,&lt;BR /&gt;monthstart(date(date('1/1/2020') + RowNo()-1)) as Month,&lt;BR /&gt;weekstart(date(date('1/1/2020') + RowNo()-1),0,0) as Week,&lt;BR /&gt;if(isnull(peek(Month)),0,&lt;BR /&gt;if(peek(Month)=monthstart(date(date('1/1/2020') + RowNo()-1))&lt;BR /&gt;,peek(MonthIndex), peek(MonthIndex)+1)&lt;BR /&gt;) as MonthIndex,&lt;BR /&gt;//MonthWeek, numbers the weeks inside a month from 0 to 5 (max weeks in a month)&lt;BR /&gt;if(date(date('1/1/2020') + RowNo()-1) =monthstart(date(date('1/1/2020') + RowNo()-1)), //start of Month&lt;BR /&gt;0,&lt;BR /&gt;if(peek(Week)=weekstart(date(date('1/1/2020') + RowNo()-1),0,0),&lt;BR /&gt;peek(MonthWeek),&lt;BR /&gt;peek(MonthWeek)+1&lt;BR /&gt;)&lt;BR /&gt;) as MonthWeek,&lt;BR /&gt;//MonthWeekStart, indicates if the date is the start of a week inside a month&lt;BR /&gt;if(date(date('1/1/2020') + RowNo()-1) =monthstart(date(date('1/1/2020') + RowNo()-1)), //start of Month&lt;BR /&gt;1,&lt;BR /&gt;if(peek(Week)=weekstart(date(date('1/1/2020') + RowNo()-1),0,0),&lt;BR /&gt;0,&lt;BR /&gt;1&lt;BR /&gt;)&lt;BR /&gt;) as MonthWeekStart,&lt;/P&gt;&lt;P&gt;if(date(date('1/1/2020') + RowNo()-1) =monthstart(date(date('1/1/2020') + RowNo()-1)), //start of Month&lt;BR /&gt;if(WeekDay(date(date('1/1/2020') + RowNo()-1))='Mon',1,0),&lt;BR /&gt;if(peek(Week)=weekstart(date(date('1/1/2020') + RowNo()-1),0,0),&lt;BR /&gt;0,&lt;BR /&gt;if(WeekDay(date(date('1/1/2020') + RowNo()-1))='Mon',1,0)&lt;BR /&gt;)&lt;BR /&gt;) as WeekStartIsAMonday&lt;BR /&gt;AutoGenerate(365);&lt;/P&gt;&lt;P&gt;IsMonday:&lt;BR /&gt;load distinct MonthIndex, MonthWeek, WeekStartIsAMonday Resident Dates where MonthWeekStart=1;&lt;/P&gt;&lt;P&gt;inner join (Dates)&lt;BR /&gt;load MonthIndex, MonthWeek, WeekStartIsAMonday as WeekStartsOnAMonday Resident IsMonday;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Data: load 'A' as Cust, Date as FactDate, floor(rand()*1000)/100 as Amount Resident Dates;&lt;BR /&gt;concatenate(Data) load 'B' as Cust, Date as FactDate, floor(rand()*1000)/100 as Amount Resident Dates;&lt;/P&gt;&lt;P&gt;Weeks: load distinct Month as BridgeMonth, MonthIndex*10 + MonthWeek as BridgeWeek,WeekStartsOnAMonday as BridgeWeekStartsOnAMonday, Date as FactDate resident Dates;&lt;/P&gt;&lt;P&gt;//this is for the last date of prior week, since its a different week, it will have a different flag for IsAMonday so its addressed another way&lt;BR /&gt;NoConcatenate&lt;BR /&gt;tmpWeeks: load Month as BridgeMonth, MonthIndex*10 + MonthWeek-1 as BridgeWeek, Date as FactDate resident Dates&lt;BR /&gt;where MonthWeekStart=1 and MonthWeek&amp;gt;0;&lt;/P&gt;&lt;P&gt;inner join (tmpWeeks)&lt;BR /&gt;load MonthIndex*10 + MonthWeek as BridgeWeek, WeekStartIsAMonday as BridgeWeekStartsOnAMonday Resident IsMonday;&lt;/P&gt;&lt;P&gt;Concatenate (Weeks)&lt;BR /&gt;load BridgeMonth, BridgeWeek, BridgeWeekStartsOnAMonday, FactDate Resident tmpWeeks;&lt;/P&gt;&lt;P&gt;drop field WeekStartIsAMonday;&lt;BR /&gt;drop table IsMonday, tmpWeeks;&lt;BR /&gt;drop table Dates;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the pivot table uses the following as dimension:&lt;BR /&gt;Cust,&lt;BR /&gt;='transactions for ' &amp;amp; date(aggr(min(FactDate),BridgeWeek)) &amp;amp; ' to ' &amp;amp; date(aggr(max(FactDate),BridgeWeek))&lt;BR /&gt;&lt;BR /&gt;Expression is just sum(Amount)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 03:29:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/week-wise-bucket/m-p/1758719#M720254</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-11-05T03:29:32Z</dc:date>
    </item>
  </channel>
</rss>

