<?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 Line Chart - Dividing values by last year's value in Insight Advisor</title>
    <link>https://community.qlik.com/t5/Insight-Advisor/Line-Chart-Dividing-values-by-last-year-s-value/m-p/1885064#M95</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I would like to create a Line Chart in Qlik Sense that shows the increase in prices compared to the same date last year. In other words, it should show&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;prices divided by last year's prices.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For example&lt;/P&gt;
&lt;P&gt;1/1/2020 Price = 1 and 1/1/2021 Price = 1.25 --&amp;gt; Shows 1.25 at 1/1/2021 because 1.25/1 = 1.25.&lt;/P&gt;
&lt;P&gt;2/1/2020 Price = 1.5 and 2/1/2021 Price = 3 --&amp;gt; Shows 2 at 2/1/2021 because 3/1.5 = 2.&lt;/P&gt;
&lt;P&gt;I want to do this with expressions. Thanks for the help!&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2022 14:54:00 GMT</pubDate>
    <dc:creator>Ax</dc:creator>
    <dc:date>2022-01-25T14:54:00Z</dc:date>
    <item>
      <title>Line Chart - Dividing values by last year's value</title>
      <link>https://community.qlik.com/t5/Insight-Advisor/Line-Chart-Dividing-values-by-last-year-s-value/m-p/1885064#M95</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I would like to create a Line Chart in Qlik Sense that shows the increase in prices compared to the same date last year. In other words, it should show&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;prices divided by last year's prices.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For example&lt;/P&gt;
&lt;P&gt;1/1/2020 Price = 1 and 1/1/2021 Price = 1.25 --&amp;gt; Shows 1.25 at 1/1/2021 because 1.25/1 = 1.25.&lt;/P&gt;
&lt;P&gt;2/1/2020 Price = 1.5 and 2/1/2021 Price = 3 --&amp;gt; Shows 2 at 2/1/2021 because 3/1.5 = 2.&lt;/P&gt;
&lt;P&gt;I want to do this with expressions. Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 14:54:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Insight-Advisor/Line-Chart-Dividing-values-by-last-year-s-value/m-p/1885064#M95</guid>
      <dc:creator>Ax</dc:creator>
      <dc:date>2022-01-25T14:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Line Chart - Dividing values by last year's value</title>
      <link>https://community.qlik.com/t5/Insight-Advisor/Line-Chart-Dividing-values-by-last-year-s-value/m-p/1885369#M96</link>
      <description>&lt;P&gt;Hi - Please proceed as below&lt;/P&gt;
&lt;P&gt;Step1: In your load script, modify your's as per script below. i.e create two fields for month and year&lt;/P&gt;
&lt;P&gt;data:&lt;BR /&gt;load Date#(date, 'm/d/yyyy') as date,&lt;BR /&gt;price,&lt;BR /&gt;num(left(date, 1)) as month,&lt;BR /&gt;num(right(date, 4)) as year&lt;BR /&gt;;&lt;BR /&gt;load * inline [&lt;BR /&gt;date, price&lt;BR /&gt;1/1/2020, 1&lt;BR /&gt;1/1/2021, 1.25&lt;BR /&gt;2/1/2020, 1.5&lt;BR /&gt;2/1/2021, 3&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;Step2: create a line chart, with 3 measures(in fact just one should be fine)&lt;BR /&gt;&lt;BR /&gt;1st measure expression: = only({&amp;lt;year = {"$(=Max(year))"}&amp;gt;} price) - label this expression as 'current year price'&lt;BR /&gt;2nd measure expression: = only({&amp;lt;year = {"$(=Max(year)-1)"}&amp;gt;} price) - label this expression as 'previous year price'&lt;BR /&gt;3rd measure expression: = [current year price]/[previous year price] - label this expression as 'kpi'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/70985i095A1635C27700FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm doing this in qlikview as i'm not able to do QS on my local machine, so you gotta put the&amp;nbsp; same in your QS.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 03:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Insight-Advisor/Line-Chart-Dividing-values-by-last-year-s-value/m-p/1885369#M96</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2022-01-26T03:54:37Z</dc:date>
    </item>
  </channel>
</rss>

