<?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 How to show yesterday's data by selecting today? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-show-yesterday-s-data-by-selecting-today/m-p/518018#M483532</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to show a comparison between a previous data&amp;nbsp; and today's data in qv. However I'm stuck because I don't know what to do so qlikview can show me today and yesterdays information by selecting today. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me explain you, I have data everyday for the last 3 years, and I neeed to see everyday how was my number 2 days ago and how is it today, in order to see if I improved or not from what happened 2 days ago.&amp;nbsp; Therefore I want to select in qv today, and to show me in one column today's information and in another 2 days ago information. I want it to show me 2 days ago information always. No matter if I select 2 months, I want to know the number of those 2 months in one column and in the other the information of 2 days ago. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jun 2013 17:57:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-27T17:57:23Z</dc:date>
    <item>
      <title>How to show yesterday's data by selecting today?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-yesterday-s-data-by-selecting-today/m-p/518018#M483532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to show a comparison between a previous data&amp;nbsp; and today's data in qv. However I'm stuck because I don't know what to do so qlikview can show me today and yesterdays information by selecting today. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me explain you, I have data everyday for the last 3 years, and I neeed to see everyday how was my number 2 days ago and how is it today, in order to see if I improved or not from what happened 2 days ago.&amp;nbsp; Therefore I want to select in qv today, and to show me in one column today's information and in another 2 days ago information. I want it to show me 2 days ago information always. No matter if I select 2 months, I want to know the number of those 2 months in one column and in the other the information of 2 days ago. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 17:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-yesterday-s-data-by-selecting-today/m-p/518018#M483532</guid>
      <dc:creator />
      <dc:date>2013-06-27T17:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to show yesterday's data by selecting today?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-show-yesterday-s-data-by-selecting-today/m-p/518019#M483533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use set analysis to accomplish this. What you will need to know is what "today" constitutes to determine yesterday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does "today" mean the actual current day, regardless of the data model? In that case, you could create a variable for yesterday like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vYesterday:&lt;EM&gt; =today()-1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will be in numeric format. If you need it as a date string, you can wrap it in date():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vYesterday:&lt;EM&gt; =date(today()-1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, "today" might just mean the most recent date available in your data or subset of data selected. To calculate this, you will need to take the max of your date field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vYesterday: &lt;EM&gt;=max([DateField])-1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;vYesterday:&lt;EM&gt; =date(max([DateField])-1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that you have determined the correct day and stored it in a variable, you can use set analysis in the expression you want to limit to yesterday. The expression would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum({&amp;lt;[DateField]={'$(vYesterday)'}&amp;gt;} Expression1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What this does it tell QlikView to calculate the sum of Expression1 where your DateField is equal to the value stored in vYesterday.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 19:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-show-yesterday-s-data-by-selecting-today/m-p/518019#M483533</guid>
      <dc:creator>skokenes</dc:creator>
      <dc:date>2013-06-27T19:15:23Z</dc:date>
    </item>
  </channel>
</rss>

