<?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: calculate yoy growth in data load editor in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/calculate-yoy-growth-in-data-load-editor/m-p/2160812#M94168</link>
    <description>&lt;P&gt;A possible solution ...&lt;/P&gt;
&lt;P&gt;To calculate the Year-over-Year (YoY) growth in Qlik Sense within the Data Load Editor, you will need to use a combination of set analysis and aggregation functions to compare the current year's values with the previous year's values for each customer. The general formula for YoY growth is as you've described:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="math math-inline"&gt;&lt;SPAN class="katex"&gt;&lt;SPAN class="katex-mathml"&gt;YoY&amp;nbsp;Growth=(Current&amp;nbsp;Year&amp;nbsp;Value−Previous&amp;nbsp;Year&amp;nbsp;ValuePrevious&amp;nbsp;Year&amp;nbsp;Value)×100&lt;/SPAN&gt;&lt;SPAN class="katex-html" aria-hidden="true"&gt;&lt;SPAN class="base"&gt;&lt;SPAN class="mord text"&gt;&lt;SPAN class="mord"&gt;YoY&amp;nbsp;Growth&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mrel"&gt;=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="base"&gt;&lt;SPAN class="minner"&gt;&lt;SPAN class="mopen delimcenter"&gt;&lt;SPAN class="delimsizing size1"&gt;(&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mord"&gt;&lt;SPAN class="mfrac"&gt;&lt;SPAN class="vlist-t vlist-t2"&gt;&lt;SPAN class="vlist-r"&gt;&lt;SPAN class="vlist"&gt;&lt;SPAN&gt;&lt;SPAN class="sizing reset-size6 size3 mtight"&gt;&lt;SPAN class="mord mtight"&gt;&lt;SPAN class="mord text mtight"&gt;Previous&amp;nbsp;Year&amp;nbsp;Value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="sizing reset-size6 size3 mtight"&gt;&lt;SPAN class="mord mtight"&gt;&lt;SPAN class="mord text mtight"&gt;Current&amp;nbsp;Year&amp;nbsp;Value&lt;/SPAN&gt;&lt;SPAN class="mbin mtight"&gt;−&lt;/SPAN&gt;&lt;SPAN class="mord text mtight"&gt;Previous&amp;nbsp;Year&amp;nbsp;Value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="vlist-s"&gt;​&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mclose delimcenter"&gt;&lt;SPAN class="delimsizing size1"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mbin"&gt;×&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="base"&gt;&lt;SPAN class="mord"&gt;100&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Here's a step-by-step approach to create a field for YoY growth in Qlik Sense:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Load Your Data&lt;/STRONG&gt;: Ensure that you have your data loaded with the fields &lt;CODE&gt;volume&lt;/CODE&gt;, &lt;CODE&gt;tkt_year&lt;/CODE&gt;, and &lt;CODE&gt;customer&lt;/CODE&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Create Variables for Current and Previous Year&lt;/STRONG&gt;: If you don't already have them, you might need to create variables to dynamically determine the current and previous year based on your data. This can be done using Qlik Sense's date functions.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Calculate YoY Growth for Each Customer&lt;/STRONG&gt;: You will need to calculate the YoY growth for each customer. This involves calculating the sum of &lt;CODE&gt;volume&lt;/CODE&gt; for the current year and the previous year for each customer, and then applying the YoY formula.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here's an example script to illustrate this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN class="" data-state="closed"&gt;&lt;BUTTON class="flex gap-1 items-center"&gt;Copy code&lt;/BUTTON&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="bg-black rounded-md"&gt;
&lt;DIV class="p-4 overflow-y-auto"&gt;&lt;CODE class="!whitespace-pre hljs language-sql"&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt; Assuming tkt_year &lt;SPAN class="hljs-keyword"&gt;is&lt;/SPAN&gt; the field &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; the transaction &lt;SPAN class="hljs-keyword"&gt;year&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;and&lt;/SPAN&gt; volume &lt;SPAN class="hljs-keyword"&gt;is&lt;/SPAN&gt; the sales volume
LOAD
    customer,
    tkt_year,
    volume,
    &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt; Other fields you might need
    ...
;

LOAD
    &lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;,
    If(tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today()), 
       (&lt;SPAN class="hljs-built_in"&gt;Sum&lt;/SPAN&gt;({&lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; {$(&lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today()))}&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt;} volume) &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;
        &lt;SPAN class="hljs-built_in"&gt;Sum&lt;/SPAN&gt;({&lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; {$(&lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today())&lt;SPAN class="hljs-number"&gt;-1&lt;/SPAN&gt;)}&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt;} volume)) &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;
        &lt;SPAN class="hljs-built_in"&gt;Sum&lt;/SPAN&gt;({&lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; {$(&lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today())&lt;SPAN class="hljs-number"&gt;-1&lt;/SPAN&gt;)}&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt;} volume),
       &lt;SPAN class="hljs-keyword"&gt;null&lt;/SPAN&gt;()) &lt;SPAN class="hljs-keyword"&gt;as&lt;/SPAN&gt; YoYcm
&lt;SPAN class="hljs-keyword"&gt;FROM&lt;/SPAN&gt; [YourDataSource]
&lt;SPAN class="hljs-keyword"&gt;GROUP&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;BY&lt;/SPAN&gt; customer, tkt_year;
&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;In this script:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;Year(Today())&lt;/CODE&gt; finds the current year.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Year(Today())-1&lt;/CODE&gt; finds the previous year.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Sum({&amp;lt;tkt_year = {$(=Year(Today()))}&amp;gt;} volume)&lt;/CODE&gt; calculates the total volume for the current year.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Sum({&amp;lt;tkt_year = {$(=Year(Today())-1)}&amp;gt;} volume)&lt;/CODE&gt; calculates the total volume for the previous year.&lt;/LI&gt;
&lt;LI&gt;The &lt;CODE&gt;If&lt;/CODE&gt; statement ensures that YoYcm is calculated only for the current year.&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Fri, 12 Jan 2024 02:52:20 GMT</pubDate>
    <dc:creator>Scotchy</dc:creator>
    <dc:date>2024-01-12T02:52:20Z</dc:date>
    <item>
      <title>calculate yoy growth in data load editor</title>
      <link>https://community.qlik.com/t5/App-Development/calculate-yoy-growth-in-data-load-editor/m-p/2159497#M94021</link>
      <description>&lt;P&gt;i need to calculate year over year growth in data load editor&lt;/P&gt;
&lt;P&gt;i have fields volume, tkt_year , customer fields and need to cm yoy growth % field in backend data load editor.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yoycm= (currentyearcm-previousyear cm/previous year cm) for each customer., how to to do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:07:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculate-yoy-growth-in-data-load-editor/m-p/2159497#M94021</guid>
      <dc:creator>Swathi</dc:creator>
      <dc:date>2024-11-15T21:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: calculate yoy growth in data load editor</title>
      <link>https://community.qlik.com/t5/App-Development/calculate-yoy-growth-in-data-load-editor/m-p/2160812#M94168</link>
      <description>&lt;P&gt;A possible solution ...&lt;/P&gt;
&lt;P&gt;To calculate the Year-over-Year (YoY) growth in Qlik Sense within the Data Load Editor, you will need to use a combination of set analysis and aggregation functions to compare the current year's values with the previous year's values for each customer. The general formula for YoY growth is as you've described:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="math math-inline"&gt;&lt;SPAN class="katex"&gt;&lt;SPAN class="katex-mathml"&gt;YoY&amp;nbsp;Growth=(Current&amp;nbsp;Year&amp;nbsp;Value−Previous&amp;nbsp;Year&amp;nbsp;ValuePrevious&amp;nbsp;Year&amp;nbsp;Value)×100&lt;/SPAN&gt;&lt;SPAN class="katex-html" aria-hidden="true"&gt;&lt;SPAN class="base"&gt;&lt;SPAN class="mord text"&gt;&lt;SPAN class="mord"&gt;YoY&amp;nbsp;Growth&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mrel"&gt;=&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="base"&gt;&lt;SPAN class="minner"&gt;&lt;SPAN class="mopen delimcenter"&gt;&lt;SPAN class="delimsizing size1"&gt;(&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mord"&gt;&lt;SPAN class="mfrac"&gt;&lt;SPAN class="vlist-t vlist-t2"&gt;&lt;SPAN class="vlist-r"&gt;&lt;SPAN class="vlist"&gt;&lt;SPAN&gt;&lt;SPAN class="sizing reset-size6 size3 mtight"&gt;&lt;SPAN class="mord mtight"&gt;&lt;SPAN class="mord text mtight"&gt;Previous&amp;nbsp;Year&amp;nbsp;Value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="sizing reset-size6 size3 mtight"&gt;&lt;SPAN class="mord mtight"&gt;&lt;SPAN class="mord text mtight"&gt;Current&amp;nbsp;Year&amp;nbsp;Value&lt;/SPAN&gt;&lt;SPAN class="mbin mtight"&gt;−&lt;/SPAN&gt;&lt;SPAN class="mord text mtight"&gt;Previous&amp;nbsp;Year&amp;nbsp;Value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="vlist-s"&gt;​&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mclose delimcenter"&gt;&lt;SPAN class="delimsizing size1"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="mbin"&gt;×&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="base"&gt;&lt;SPAN class="mord"&gt;100&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Here's a step-by-step approach to create a field for YoY growth in Qlik Sense:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Load Your Data&lt;/STRONG&gt;: Ensure that you have your data loaded with the fields &lt;CODE&gt;volume&lt;/CODE&gt;, &lt;CODE&gt;tkt_year&lt;/CODE&gt;, and &lt;CODE&gt;customer&lt;/CODE&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Create Variables for Current and Previous Year&lt;/STRONG&gt;: If you don't already have them, you might need to create variables to dynamically determine the current and previous year based on your data. This can be done using Qlik Sense's date functions.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Calculate YoY Growth for Each Customer&lt;/STRONG&gt;: You will need to calculate the YoY growth for each customer. This involves calculating the sum of &lt;CODE&gt;volume&lt;/CODE&gt; for the current year and the previous year for each customer, and then applying the YoY formula.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here's an example script to illustrate this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN class="" data-state="closed"&gt;&lt;BUTTON class="flex gap-1 items-center"&gt;Copy code&lt;/BUTTON&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="bg-black rounded-md"&gt;
&lt;DIV class="p-4 overflow-y-auto"&gt;&lt;CODE class="!whitespace-pre hljs language-sql"&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt; Assuming tkt_year &lt;SPAN class="hljs-keyword"&gt;is&lt;/SPAN&gt; the field &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; the transaction &lt;SPAN class="hljs-keyword"&gt;year&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;and&lt;/SPAN&gt; volume &lt;SPAN class="hljs-keyword"&gt;is&lt;/SPAN&gt; the sales volume
LOAD
    customer,
    tkt_year,
    volume,
    &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt; Other fields you might need
    ...
;

LOAD
    &lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;,
    If(tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today()), 
       (&lt;SPAN class="hljs-built_in"&gt;Sum&lt;/SPAN&gt;({&lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; {$(&lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today()))}&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt;} volume) &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;
        &lt;SPAN class="hljs-built_in"&gt;Sum&lt;/SPAN&gt;({&lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; {$(&lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today())&lt;SPAN class="hljs-number"&gt;-1&lt;/SPAN&gt;)}&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt;} volume)) &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;
        &lt;SPAN class="hljs-built_in"&gt;Sum&lt;/SPAN&gt;({&lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;tkt_year &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; {$(&lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;Year&lt;/SPAN&gt;(Today())&lt;SPAN class="hljs-number"&gt;-1&lt;/SPAN&gt;)}&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt;} volume),
       &lt;SPAN class="hljs-keyword"&gt;null&lt;/SPAN&gt;()) &lt;SPAN class="hljs-keyword"&gt;as&lt;/SPAN&gt; YoYcm
&lt;SPAN class="hljs-keyword"&gt;FROM&lt;/SPAN&gt; [YourDataSource]
&lt;SPAN class="hljs-keyword"&gt;GROUP&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;BY&lt;/SPAN&gt; customer, tkt_year;
&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;In this script:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;Year(Today())&lt;/CODE&gt; finds the current year.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Year(Today())-1&lt;/CODE&gt; finds the previous year.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Sum({&amp;lt;tkt_year = {$(=Year(Today()))}&amp;gt;} volume)&lt;/CODE&gt; calculates the total volume for the current year.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Sum({&amp;lt;tkt_year = {$(=Year(Today())-1)}&amp;gt;} volume)&lt;/CODE&gt; calculates the total volume for the previous year.&lt;/LI&gt;
&lt;LI&gt;The &lt;CODE&gt;If&lt;/CODE&gt; statement ensures that YoYcm is calculated only for the current year.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 12 Jan 2024 02:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculate-yoy-growth-in-data-load-editor/m-p/2160812#M94168</guid>
      <dc:creator>Scotchy</dc:creator>
      <dc:date>2024-01-12T02:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: calculate yoy growth in data load editor</title>
      <link>https://community.qlik.com/t5/App-Development/calculate-yoy-growth-in-data-load-editor/m-p/2160881#M94183</link>
      <description>&lt;P&gt;Hi Swathi,&lt;/P&gt;
&lt;P&gt;Please share a sample of the basic fields that you have in the table, &amp;amp; also at which level are you supposed to calculate the Growth ?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Rohan.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 06:47:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculate-yoy-growth-in-data-load-editor/m-p/2160881#M94183</guid>
      <dc:creator>Rohan</dc:creator>
      <dc:date>2024-01-12T06:47:27Z</dc:date>
    </item>
  </channel>
</rss>

