<?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: Straight table with dates from variable not from selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112679#M367781</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;If you are looking for result IRRESPECTIVE of selection , please go like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=ONLY({1&amp;lt;Date={"&amp;gt;=$(=(=&lt;SPAN style="color: #0000ff;"&gt;Date(varViewDate-7,'MM/DD/YYYY'&lt;/SPAN&gt;))&amp;lt;=$(=Date(&lt;SPAN style="color: #0000ff;"&gt;varViewDate,'MM/DD/YYYY'))&lt;/SPAN&gt;"}&amp;gt;} Revenue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Ian highlighte in blue : please modify according to you Date field format DD/MM or YYY/DD etc.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think above should give Revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you looking for sum ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=SUM({1&amp;lt;Date={"&amp;gt;=$(=(=Date(varViewDate-7,'MM/DD/YYYY'))&amp;lt;=$(=Date(varViewDate,'MM/DD/YYYY'))"}&amp;gt;} Revenue)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2016 18:56:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-06-24T18:56:00Z</dc:date>
    <item>
      <title>Straight table with dates from variable not from selection</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112678#M367780</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 have a straight table with a dimension based on a date variable:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;=if(Date&amp;gt;=($(varViewDate)-7) and Date&amp;lt;=($(varViewDate)-1), Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This shows 1 row for each of the 7 days before the date in the variable. Eventually the variable will be today() and will show the 7 days data before today, but I am using a variable because the test data isn't current.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expressions in the straight table are as simple as you can get:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;=Revenue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;=Budget&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;with no summation or interpretation of the data required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I have is unlinking this information from any date selections. In the same application users will be able to perform analysis based on date selections, but I don't want this table to be affected by those date selections.&lt;/P&gt;&lt;P&gt;However I do want the users to be able to filter on location, so I cannot detach the table to fix the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought using set analysis with the same expression as used in the dimension would work, but I just get "Errors in expression" because Only is not what I actually want. I tried the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;=Only({1 &amp;lt;if(Date&amp;gt;=($(varViewDate)-7) and Date&amp;lt;=($(varViewDate)-1)} &amp;gt; Revenue)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;=Only( {1 &amp;lt; Date={($(varViewDate)-7),($(varViewDate)-6),($(varViewDate)-5),($(varViewDate)-4),($(varViewDate)-3),($(varViewDate)-2),($(varViewDate)-1)}&amp;gt;} Revenue) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's occurred to me this might be possible without set analysis, but using the {1} Total set seems the obvious solution. I probably need a different function but most examples use the sum function, which does seem necessary when I only want 1 value, rather than the sum of values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My QlikView journey is just starting, so any help appreciated. I'm also waiting for my developer license, so am still using a personal edition at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 18:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112678#M367780</guid>
      <dc:creator>ianwilson</dc:creator>
      <dc:date>2016-06-24T18:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Straight table with dates from variable not from selection</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112679#M367781</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;If you are looking for result IRRESPECTIVE of selection , please go like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=ONLY({1&amp;lt;Date={"&amp;gt;=$(=(=&lt;SPAN style="color: #0000ff;"&gt;Date(varViewDate-7,'MM/DD/YYYY'&lt;/SPAN&gt;))&amp;lt;=$(=Date(&lt;SPAN style="color: #0000ff;"&gt;varViewDate,'MM/DD/YYYY'))&lt;/SPAN&gt;"}&amp;gt;} Revenue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Ian highlighte in blue : please modify according to you Date field format DD/MM or YYY/DD etc.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think above should give Revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you looking for sum ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=SUM({1&amp;lt;Date={"&amp;gt;=$(=(=Date(varViewDate-7,'MM/DD/YYYY'))&amp;lt;=$(=Date(varViewDate,'MM/DD/YYYY'))"}&amp;gt;} Revenue)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 18:56:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112679#M367781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-24T18:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Straight table with dates from variable not from selection</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112680#M367782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please go through this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-9162"&gt;Set Analysis for certain Point in Time&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 18:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112680#M367782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-24T18:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Straight table with dates from variable not from selection</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112681#M367783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;He wants to be able to filter by location, and I assume by any non-date-related fields. So as a modification to your expression, I think we'll need to ignore all date-related fields rather than use {1}. So if we have Year, Month, and Week in our calendar along with the Date, perhaps something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;only({&amp;lt;Year=,Month=,Week=,Date={"&amp;gt;=$(=(=Date(varViewDate-7,'MM/DD/YYYY'))&amp;lt;=$(=Date(varViewDate,'MM/DD/YYYY'))"}&amp;gt;} Revenue)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 19:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112681#M367783</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-06-24T19:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Straight table with dates from variable not from selection</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112682#M367784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Allu and John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick response. I've tried the following variations on the suggestions, but not got to the field exclusions yet - need to get the basic set working first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;None of these other than the basic "=Revenue" returns any values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//=Revenue&lt;BR /&gt;//&lt;BR /&gt;//=Only({1&amp;lt;Date={"&amp;gt;=$(=(=Date(varViewDate-7,'DD/MM/YYYY'))&amp;lt;=$(=Date(varViewDate-1,'DD/MM/YYYY'))"}&amp;gt;}Revenue)&lt;BR /&gt;//&lt;BR /&gt;//=ONLY({1&amp;lt;Date={"&amp;gt;=$(=(=Date(varViewDate-7,'DD/MM/YYYY'))&amp;lt;=$(=Date(varViewDate,'DD/MM/YYYY'))"}&amp;gt;}Revenue)&lt;BR /&gt;//&lt;BR /&gt;//=ONLY({1&amp;lt;Date={"&amp;gt;=$(varViewDate-7)&amp;lt;=$(varViewDate-1)"}&amp;gt;}Revenue)&lt;BR /&gt;//&lt;BR /&gt;//=ONLY({1&amp;lt;Date={"&amp;gt;=($(varViewDate)-7)&amp;lt;=($(varViewDate)-1)"}&amp;gt;}Revenue)&lt;BR /&gt;//&lt;BR /&gt;//=ONLY({1&amp;lt;Date={"&amp;gt;=(=Date(($(varViewDate)-7),'DD/MM/YYYY'))&amp;lt;=(=Date(($(varViewDate)-1),'DD/MM/YYYY'))"}&amp;gt;}Revenue)&lt;/P&gt;&lt;P&gt;//=ONLY({1&amp;lt;Date={"&amp;gt;=(=Date($(varViewDate)-7))&amp;lt;=(=Date($(varViewDate)-1))"}&amp;gt;}Revenue)&lt;/P&gt;&lt;P&gt;//=ONLY({1&amp;lt;Date={"&amp;gt;=Date(($(varViewDate)-7),'DD/MM/YYYY')&amp;lt;=Date(($(varViewDate)-1),'DD/MM/YYYY')"}&amp;gt;}Revenue)&lt;/P&gt;&lt;P&gt;=ONLY({1&amp;lt;Date={"&amp;gt;=Date($(varViewDate)-7)&amp;lt;=Date($(varViewDate)-1)"}&amp;gt;}Revenue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After some testing with text fields I found the following expressions all return the correct date in DD/MM/YYYY or in the correct Number value i.e. 42523&lt;/P&gt;&lt;P&gt;$(=(=Date(varViewDate-7,'DD/MM/YYYY'))&lt;/P&gt;&lt;P&gt;Date(($(varViewDate)-7),'DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;$(varViewDate)-7)&lt;/P&gt;&lt;P&gt;Date($(varViewDate)-7)&lt;/P&gt;&lt;P&gt;So I don't think I have an issue with the date formats, having tested them in text fields and tried all 4 different ways of writing them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Set expression to select the date with the &amp;gt;= and &amp;lt;= makes perfect sense to me, but I still don't get any values in the Revenue field:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="straight table.png" class="jive-image image-1" src="/legacyfs/online/129149_straight table.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;I haven't applied set analysis to the other fields yet so they are still displaying data with a basic =Budget type expression. The date field is just for troubleshooting at this time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to have a read of the suggestion below &lt;A href="https://community.qlik.com/docs/DOC-9162"&gt;Set Analysis for certain Point in Time&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 20:10:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112682#M367784</guid>
      <dc:creator>ianwilson</dc:creator>
      <dc:date>2016-06-24T20:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Straight table with dates from variable not from selection</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112683#M367785</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 now realise I didn't understand the difference between the Total Set for a specific date range and the Current Set excluding dates &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;.&amp;nbsp; After sleeping on it and rereading the posts I realised my mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'&amp;gt;=$(=(varViewDate)-7)&amp;lt;=$(=(varViewDate)-1)'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Revenue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Which takes the revenue for the current selection, but only for the dates in the range of the variable, ignoring any date selection. ( Obviously! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;This may have an issue if I have duplicate values for Revenue in this range - need to check - and I need to check out the impact of the Date formatting, as it is probably not best practice to have a bare variable in a date expression, but it works and I understand why.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks for the help - much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jun 2016 12:58:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-table-with-dates-from-variable-not-from-selection/m-p/1112683#M367785</guid>
      <dc:creator>ianwilson</dc:creator>
      <dc:date>2016-06-26T12:58:49Z</dc:date>
    </item>
  </channel>
</rss>

