<?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: Re: Expression for Start end date - SET Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581278#M215898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attachment would help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2014 10:45:21 GMT</pubDate>
    <dc:creator>CELAMBARASAN</dc:creator>
    <dc:date>2014-03-17T10:45:21Z</dc:date>
    <item>
      <title>Expression for Start end date - SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581274#M215894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help to create a SET-analysis expression instead of my if-statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this expression:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if( Startdate &amp;lt;= date(Month,'YYYYMM') xor date(Month,'YYYYMM') &amp;gt;= Enddate,sum(Amount))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression gives the correct result but it takes very long time to calculate it for Qlikview. I have around 40 thousands of ID's with startdates from 2014-01-01 to 2039-12-31 it gives me many rows to generate the dates in the script. Every ServiceId has a uniqe start and enddate. I've also created i report structure so the serviceId's occurs on multiple places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Calendar is a data island.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do is to create i SET-expression of my expression instead of the if-statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached a sample-file with a example (not for the report structure).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/AG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 09:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581274#M215894</guid>
      <dc:creator>atafsson</dc:creator>
      <dc:date>2014-03-17T09:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for Start end date - SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581275#M215895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Island data cannot be linked by using set analysis.&lt;/P&gt;&lt;P&gt;Why cannot you link those 2 tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 09:43:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581275#M215895</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2014-03-17T09:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for Start end date - SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581276#M215896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to, but I don't know how to create the link between them because of the start and enddate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should the the link to the calendar table take both start- and end-date into account?&lt;/P&gt;&lt;P&gt;How will I generate the dates in the chart between start- and end-date?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 10:04:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581276#M215896</guid>
      <dc:creator>atafsson</dc:creator>
      <dc:date>2014-03-17T10:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for Start end date - SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581277#M215897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed this part of script&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(addmonths($(vMin),IterNo()-1)) as %Year&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,MonthStart(addmonths($(vMin),IterNo()-1)) as Month&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Year(addmonths($(vMin),IterNo()-1)) &amp;amp; num(month(MonthStart(addmonths($(vMin),IterNo()-1))),'00') as YearMonth&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;STRONG&gt;Date($(vMin)+(Iterno()-1),'YYYY-MM-DD') as Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,month(MonthStart(addmonths($(vMin),IterNo()-1))) as Month2&lt;/P&gt;&lt;P&gt;AutoGenerate(1)&lt;/P&gt;&lt;P&gt;//while addmonths($(vMin),IterNo()-1) &amp;lt;= $(vMax)&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;While Date($(vMin)+(Iterno()-1)) &amp;lt;=Date($(vMax));&lt;/P&gt;&lt;P&gt;drop table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LinkTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ServiceId,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date((Startdate + IterNo() - 1), 'YYYY-MM-DD') AS Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Tmp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;While (Startdate + IterNo() - 1) &amp;lt;= Enddate;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And Use Expression as simply Sum(Amount)&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;There was a issue calendar generation, use the below script&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calendar:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Year(Date) as %Year&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ,MonthStart(Date) as Month&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ,Num#(Text(Date(Date, 'YYYYMM'))) as YearMonth&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ,month(MonthStart(Date)) as Month2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date($(vMin)+(Iterno()-1),'YYYY-MM-DD') as Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AutoGenerate(1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;//while addmonths($(vMin),IterNo()-1) &amp;lt;= $(vMax)&amp;nbsp; ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;While Date($(vMin)+(Iterno()-1)) &amp;lt;=Date($(vMax));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop table Temp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LinkTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ServiceId,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Date((Startdate + IterNo() - 1), 'YYYY-MM-DD') AS Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Tmp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;While (Startdate + IterNo() - 1) &amp;lt;= Enddate;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Celambarasan&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 10:16:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581277#M215897</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2014-03-17T10:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Expression for Start end date - SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581278#M215898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attachment would help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 10:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581278#M215898</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2014-03-17T10:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for Start end date - SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581279#M215899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that with the LinkTable the script needs to generate all dates from start to end for each ServiceId.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my real application it counted up to around 200 million rows in the LinkTable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an other way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 12:37:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-for-Start-end-date-SET-Analysis/m-p/581279#M215899</guid>
      <dc:creator>atafsson</dc:creator>
      <dc:date>2014-03-17T12:37:43Z</dc:date>
    </item>
  </channel>
</rss>

