<?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 Set Analysis - Less than today + Greater than today in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991121#M337723</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to produce a chart where I want to show a different set of results depending on the timescale, i.e. if the week is less than the week number for today, I want to show sales, but for this week or greater than this week, I want to show forecast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The if statement I've done works fine, but when I try to add a sub total to the timescale, it doesn't calculate correctly as it only shows me the sales or the forecast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the current expression I've done:&lt;/P&gt;&lt;P&gt;if(Timescale&amp;lt; year(today())&amp;amp;'.'&amp;amp;num(week(today()),'00'), &lt;/P&gt;&lt;P&gt;sum(tr_as_qty_loc) *-1, &lt;/P&gt;&lt;P&gt;if(Timescale &amp;gt;= year(today())&amp;amp;'.'&amp;amp;num(week(today()),'00'), &lt;/P&gt;&lt;P&gt;sum( [FCS_Qty]),&lt;/P&gt;&lt;P&gt;0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I need to do it using a set analysis expression, but struggling to get the syntax! Any help would be greatly appreciated &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;Many thanks!&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Sep 2015 12:37:45 GMT</pubDate>
    <dc:creator>Dayna</dc:creator>
    <dc:date>2015-09-21T12:37:45Z</dc:date>
    <item>
      <title>Set Analysis - Less than today + Greater than today</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991121#M337723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to produce a chart where I want to show a different set of results depending on the timescale, i.e. if the week is less than the week number for today, I want to show sales, but for this week or greater than this week, I want to show forecast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The if statement I've done works fine, but when I try to add a sub total to the timescale, it doesn't calculate correctly as it only shows me the sales or the forecast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the current expression I've done:&lt;/P&gt;&lt;P&gt;if(Timescale&amp;lt; year(today())&amp;amp;'.'&amp;amp;num(week(today()),'00'), &lt;/P&gt;&lt;P&gt;sum(tr_as_qty_loc) *-1, &lt;/P&gt;&lt;P&gt;if(Timescale &amp;gt;= year(today())&amp;amp;'.'&amp;amp;num(week(today()),'00'), &lt;/P&gt;&lt;P&gt;sum( [FCS_Qty]),&lt;/P&gt;&lt;P&gt;0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I need to do it using a set analysis expression, but struggling to get the syntax! Any help would be greatly appreciated &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;Many thanks!&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 12:37:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991121#M337723</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2015-09-21T12:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Less than today + Greater than today</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991122#M337724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is that you are using a pivot table, since you mentioned the Sub-Totals. I believe that if you are getting correct values on row level, you might be able to get the sub-totals right by using the Sum(Aggr(...)) function. I suggest sharing some sample data with your expected result to help you better here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 12:40:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991122#M337724</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-09-21T12:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Less than today + Greater than today</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991123#M337725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately with set analysis you can include only one condition so you can easily compute &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(tr_as_qty_loc) *-1 where Timescale&amp;lt; year(today())&amp;amp;'.'&amp;amp;num(week(today()),'00')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but you cannot perform a comparison between 2 or more conditions without using an if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 12:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991123#M337725</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-09-21T12:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Less than today + Greater than today</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991124#M337726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can write it as two formulas. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Date={"&amp;lt;Today()"}&amp;gt;} &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;tr_as_qty_loc&lt;/SPAN&gt;) * -1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=Today()"}&amp;gt;} &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FCS_Qty&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 12:49:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991124#M337726</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2015-09-21T12:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Less than today + Greater than today</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991125#M337727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That sounds like my problem! I've attached the application with an example product with my current application. Thank you for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 12:49:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991125#M337727</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2015-09-21T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Less than today + Greater than today</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991126#M337728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something I always seem to struggle with in set analysis is date formatting - as I doesn't work on dates, but weekname. Would something like '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({&amp;lt;Timescale={"&amp;gt;=weekname(Today())"}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FCS_Qty&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;)' still have the same effect or do I have to do something fancy in QlikView?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 12:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991126#M337728</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2015-09-21T12:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Less than today + Greater than today</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991127#M337729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is why you usually build a Master Calendar for your applications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on how Timescale is formatted it is possible to create a date using MakeWeekDate(Year, Week). &lt;/P&gt;&lt;P&gt;If Timescale has the format 2015-12, then you can add a line in your script when you load your Timescale:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MakeWeekDate(Subfield(Timescale,'-',1),Subfield(Timescale,'-',2)) as Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I usually also create a variable when loading the application:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vTodayDate = Floor(Today(1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the set analysis becomes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(vTodayDate)"}&amp;gt;} FCS_Qty)&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum({&amp;lt;Date={"&amp;lt;$(vTodayDate)"}&amp;gt;} tr_as_qty_loc)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 07:57:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Less-than-today-Greater-than-today/m-p/991127#M337729</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2015-09-22T07:57:24Z</dc:date>
    </item>
  </channel>
</rss>

