<?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: master calendar script within a table load? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160843#M634621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your explanation Steve and I hope your solution works in your full application. It sounds like a very complex scenario.&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2016 12:28:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-19T12:28:45Z</dc:date>
    <item>
      <title>master calendar script within a table load?</title>
      <link>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160840#M634618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community, I'm generally familiar with master calendars and have plenty of ideas to experiment with, but posting here in case anyone has a ready solution and I spend my day hitting dead-ends. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we have a regular master calendar setup to follow calendar years, but now I need customized calendars that track with 4- and 6- week activities that various clients have.&amp;nbsp; The database table I have for these activities is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActivityID&amp;nbsp;&amp;nbsp; StartDate&amp;nbsp;&amp;nbsp; EndDate&lt;/P&gt;&lt;P&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/28/2016&lt;/P&gt;&lt;P&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/28/2016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically, I need activity calendar weeks that flow from the various StartDates, so when the end user selects challenge 123, the Challenge Weeks go 1 to 4 in 7-day increments from 1/1/2016.&amp;nbsp; And if they select challenge 456, the challenge weeks start week 1 on 2/1/2016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Things I ruled out:&lt;/P&gt;&lt;P&gt;Expression in the table didn't like me inserting min(MCDate) stuff into the if statements.&lt;/P&gt;&lt;P&gt;Calculated dimension laughed at my dual if statement and gave a //error in calculation&lt;/P&gt;&lt;P&gt;I have a master calendar with all the days populated, and did like:&lt;/P&gt;&lt;P&gt;sum(if(MCDate&amp;gt;=min(MCDate) AND MCDate&amp;lt;=(min(MCDate)+6), Minutes)) for the expression that failed.&lt;/P&gt;&lt;P&gt;I pushed the date range definitions out to a dual if statement in the calculated dimension, and cut the expression down to just sum(Minutes), but the calculated dimension didn't work either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm looking back at the script to see if I can create a ChallengeWeeks field there to use as a dimension on the front, and sum(Minutes) on that field in the front.&amp;nbsp; I'll be playing with that now, and look forward to any input from anyone else who has had the same kind of requirements.&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;***Edit:&lt;/STRONG&gt;&lt;/SPAN&gt; It was min(MCDate) I was trying to work with initially and user would select the challenge dates on the master calendar.&amp;nbsp; I'm just now bringing in the actual challenge dates in script to see if I can make smarter expressions.&amp;nbsp; I might actually be okay doing the expression with StartDate and StartDate+6 once I have it in actually, since no min() to confuse it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit2: And making the challengeweeks field in script is probably the optimal solution so the tables on the front don't have to handle those computations every time a selection is made.&amp;nbsp; I will do that if I see how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 16:01:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160840#M634618</guid>
      <dc:creator>stevelord</dc:creator>
      <dc:date>2016-05-17T16:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: master calendar script within a table load?</title>
      <link>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160841#M634619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve&lt;/P&gt;&lt;P&gt;I may be wrong here but would as of table not help you with this scenario?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 16:10:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160841#M634619</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-17T16:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: master calendar script within a table load?</title>
      <link>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160842#M634620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Brian, I googled that and found a nice detailed training/blog about 'as of' tables here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4531"&gt;The As-Of Table&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like it would work beautifully with a single calendar, but I'm not sure how it will cope with the fairly random start/end date periods of the various client activities that are happening.&amp;nbsp; For instance, one client's 'Week 1' might be Jan1 - Jan 7, and another client's 'Week 1' might be.. April 15 - April 21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I've done instead is load the table with all the client activity start/end dates:&lt;/P&gt;&lt;P&gt;Client&amp;nbsp; Activity StartDate EndDate&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2016&amp;nbsp; 1/28/2016&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; walk&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/1/2016 2/28/2016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also a table listing which people belong to which client,&lt;/P&gt;&lt;P&gt;and another table listing the people, how much they did, and when they did it (activity date)&lt;/P&gt;&lt;P&gt;the people's activity dates are connected to a master calendar so we can see days of no activity too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the front I have a straight table like this:&lt;/P&gt;&lt;P&gt;Dimensions: Client, Activity, StartDate, EndDate&lt;/P&gt;&lt;P&gt;Expressions:&lt;/P&gt;&lt;P&gt;1. Sum minutes people logged in 'week 1' of their respective activity:&lt;/P&gt;&lt;P&gt;=sum(if([ActivityDate]&amp;gt;=StartDate AND [ActivityDate]&amp;lt;=StartDate+6 AND [ActivityDate]&amp;lt;=EndDate, [Activity Minutes]))&lt;/P&gt;&lt;P&gt;2-6. and five more expressions like that adjusted to cover the 6 weeks each activity period can last.&lt;/P&gt;&lt;P&gt;Since some only go 4 weeks, I put conditional shows on the columns and the &amp;lt;=EndDate in the expression to show only columns with data and data during the activity period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My approach works nicely with a few small fake test spreadsheets.&amp;nbsp; Will see how it goes when I plug it into a database with millions of rows for qlikview to run computations on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will say that the 'as of' table approach's expressions looked slightly less demanding on the front end, aside from the fact only 1 might be needed.&amp;nbsp; But it also looks like it needs a pivot table and pivot tables always seemed a tad more demanding than straight tables- especially when I start chuckng in percents next to sums or the like- pivot tables get tricky fast when you want to add more expressions where straight tables let you do whatever you want.&amp;nbsp; Sense of pivot tables being more demanding on resources could be my imagination though- I know the act of pivoting a column is demanding, but maybe it's no different from straight tables once pivoted and locked in.&amp;nbsp; 'As of' table is probably a lot friendlier with more complex expressions though since the weeks/months are defined in a field, and I like the idea of just pivoting 1 expression vs copy/pasting practically the same one many times, so I will definitely keep it in mind if I hit a wall with my current approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now, I'm not sure how it behaves with the multiple/random date ranges I'm working with on one table, and I have something I'm sure of that's okay for these 4-6 week activity periods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS&amp;gt; Apologies for poor organization and any other editting issues, just typing fast and getting back to work now.&amp;nbsp; I tried to make this helpful for posterity since there are advantages and drawbacks to either approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 18:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160842#M634620</guid>
      <dc:creator>stevelord</dc:creator>
      <dc:date>2016-05-18T18:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: master calendar script within a table load?</title>
      <link>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160843#M634621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your explanation Steve and I hope your solution works in your full application. It sounds like a very complex scenario.&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 12:28:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160843#M634621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-19T12:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: master calendar script within a table load?</title>
      <link>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160844#M634622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, In my question I was initially envisioning a way to use master calendar script inside the load of the table itself, to create a Weeks field populates values based on the startdate values and some math for each activity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD ClientActivityInfo&lt;/P&gt;&lt;P&gt;Client,&lt;/P&gt;&lt;P&gt;ActivityName,&lt;/P&gt;&lt;P&gt;StartDate,&lt;/P&gt;&lt;P&gt;EndDate&lt;/P&gt;&lt;P&gt;From databasetable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join load... some master calendar script and computations defining Weeks using StartDate as vMinDate and EndDate as vMaxDate &amp;lt;--If I have time or my other solution doesn't work, I'd probably spend a few hours trial/erroring my way through this and maybe 60% chance of getting nowhere on it until I know more next year &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store into qvd, drop table, and reload single table next.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final table in data model would look like&lt;/P&gt;&lt;P&gt;Client ActivityName StartDate EndDate CalendarDate Week&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&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; 1/1/16&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; 1/28/16&amp;nbsp; 1/1/16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&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; 1/1/16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/28/16&amp;nbsp;&amp;nbsp; 1/2/16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; &lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&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;&amp;nbsp; 1/1/16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/28/16&amp;nbsp;&amp;nbsp; 1/3/16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&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;&amp;nbsp;&amp;nbsp; 1/1/16&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;&amp;nbsp; 1/28/16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/28/16&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp; walk&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; 2/1/16&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;&amp;nbsp;&amp;nbsp; 2/28/16&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/1/16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the pivot table on the front would look like&lt;/P&gt;&lt;P&gt;Dimensions: Client, ActivityName, Week - and Week pivoted to horizontal&lt;/P&gt;&lt;P&gt;Expression: Sum(Activity Minutes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client ActivityName Week 1 2 3 4&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; walk&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10 20 35 50&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&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;&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;&amp;nbsp; 15 60&amp;nbsp; 45 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 13:51:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/master-calendar-script-within-a-table-load/m-p/1160844#M634622</guid>
      <dc:creator>stevelord</dc:creator>
      <dc:date>2016-05-19T13:51:00Z</dc:date>
    </item>
  </channel>
</rss>

