<?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: Task in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Task/m-p/2413090#M13303</link>
    <description>&lt;P&gt;// Loading data from CSV&lt;/P&gt;
&lt;P&gt;filestock_data:&lt;BR /&gt;LOAD&lt;BR /&gt;DATE,&lt;BR /&gt;CLOSING_STOCK&lt;BR /&gt;FROM&lt;BR /&gt;[stock_data.csv]&lt;BR /&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Converting the DATE column to date&lt;/P&gt;
&lt;P&gt;formatstock_data:&lt;BR /&gt;LOAD&lt;BR /&gt;DATE,&lt;BR /&gt;Date#(DATE, 'M/D/YYYY') AS DateFormatted,&lt;BR /&gt;CLOSING_STOCK&lt;BR /&gt;RESIDENT&lt;BR /&gt;stock_data;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Finding the lowest closing value in the last 6 months&lt;/P&gt;
&lt;P&gt;LastSixMonthsMinClosingStock:&lt;BR /&gt;LOAD&lt;BR /&gt;Min(CLOSING_STOCK) as MinClosingStockLastSixMonths&lt;BR /&gt;RESIDENT&lt;BR /&gt;stock_data&lt;BR /&gt;WHERE&lt;BR /&gt;DateFormatted &amp;gt;= AddMonths(Today(), -6);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Joining the data with the lowest closing value of the last 6 months&lt;/P&gt;
&lt;P&gt;JOIN&lt;BR /&gt;LOAD&lt;BR /&gt;MinClosingStockLastSixMonths&lt;BR /&gt;RESIDENT&lt;BR /&gt;LastSixMonthsMinClosingStock;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Calculating the difference for each date&lt;/P&gt;
&lt;P&gt;stock_data_with_difference:&lt;BR /&gt;LOAD&lt;BR /&gt;DATE,&lt;BR /&gt;DateFormatted,&lt;BR /&gt;CLOSING_STOCK,&lt;BR /&gt;MinClosingStockLastSixMonths,&lt;BR /&gt;If(MinClosingStockLastSixMonths &amp;lt; CLOSING_STOCK, CLOSING_STOCK - MinClosingStockLastSixMonths, CLOSING_STOCK - Min(CLOSING_STOCK)) AS StockDifference&lt;BR /&gt;RESIDENT&lt;BR /&gt;stock_data;&lt;/P&gt;
&lt;P&gt;// Saving data to be used in visualizations&lt;BR /&gt;DROP TABLE LastSixMonthsMinClosingStock;&lt;BR /&gt;DROP FIELD DateFormatted;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2024 13:59:25 GMT</pubDate>
    <dc:creator>Bianchi</dc:creator>
    <dc:date>2024-01-31T13:59:25Z</dc:date>
    <item>
      <title>Task</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Task/m-p/2164146#M13267</link>
      <description>&lt;DIV&gt;DATA contains date and closing stock for the day. Closing stock for the month is equal to the value of closing stock at the end of the month . (eg: closing stock APR = closing&amp;nbsp;stock on 30th APR).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;case 1. Least closing stock value in the last 6 months&amp;nbsp;has to be subtracted from the stock value of current&amp;nbsp;month's stock for everyday.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;case2. If&amp;nbsp; Least closing stock value in the last 6 months is less than the closing stock of any day of the current month then find the least value of closing stock from the current month and subtract it from each day's stock.&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jan 2024 05:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Task/m-p/2164146#M13267</guid>
      <dc:creator>Janmeet</dc:creator>
      <dc:date>2024-01-23T05:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Task</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Task/m-p/2412363#M13294</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/226851"&gt;@Janmeet&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I would reload the data and join back to your closing stock value eg.&lt;/P&gt;
&lt;P&gt;Left Join (DATA)&lt;BR /&gt;Load Min([Closing Stock] as 'MinClosingStock'&lt;BR /&gt;Resident DATA;&lt;/P&gt;
&lt;P&gt;If you a stock code as well, you will add this to your load and Group by this dimension.&lt;/P&gt;
&lt;P&gt;For case 2&lt;BR /&gt;I would start by creating a month dimension on your data set and then use the same method as described above but loading and grouping by the month dimension as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 08:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Task/m-p/2412363#M13294</guid>
      <dc:creator>williejacobs</dc:creator>
      <dc:date>2024-01-30T08:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Task</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Task/m-p/2413090#M13303</link>
      <description>&lt;P&gt;// Loading data from CSV&lt;/P&gt;
&lt;P&gt;filestock_data:&lt;BR /&gt;LOAD&lt;BR /&gt;DATE,&lt;BR /&gt;CLOSING_STOCK&lt;BR /&gt;FROM&lt;BR /&gt;[stock_data.csv]&lt;BR /&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Converting the DATE column to date&lt;/P&gt;
&lt;P&gt;formatstock_data:&lt;BR /&gt;LOAD&lt;BR /&gt;DATE,&lt;BR /&gt;Date#(DATE, 'M/D/YYYY') AS DateFormatted,&lt;BR /&gt;CLOSING_STOCK&lt;BR /&gt;RESIDENT&lt;BR /&gt;stock_data;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Finding the lowest closing value in the last 6 months&lt;/P&gt;
&lt;P&gt;LastSixMonthsMinClosingStock:&lt;BR /&gt;LOAD&lt;BR /&gt;Min(CLOSING_STOCK) as MinClosingStockLastSixMonths&lt;BR /&gt;RESIDENT&lt;BR /&gt;stock_data&lt;BR /&gt;WHERE&lt;BR /&gt;DateFormatted &amp;gt;= AddMonths(Today(), -6);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Joining the data with the lowest closing value of the last 6 months&lt;/P&gt;
&lt;P&gt;JOIN&lt;BR /&gt;LOAD&lt;BR /&gt;MinClosingStockLastSixMonths&lt;BR /&gt;RESIDENT&lt;BR /&gt;LastSixMonthsMinClosingStock;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Calculating the difference for each date&lt;/P&gt;
&lt;P&gt;stock_data_with_difference:&lt;BR /&gt;LOAD&lt;BR /&gt;DATE,&lt;BR /&gt;DateFormatted,&lt;BR /&gt;CLOSING_STOCK,&lt;BR /&gt;MinClosingStockLastSixMonths,&lt;BR /&gt;If(MinClosingStockLastSixMonths &amp;lt; CLOSING_STOCK, CLOSING_STOCK - MinClosingStockLastSixMonths, CLOSING_STOCK - Min(CLOSING_STOCK)) AS StockDifference&lt;BR /&gt;RESIDENT&lt;BR /&gt;stock_data;&lt;/P&gt;
&lt;P&gt;// Saving data to be used in visualizations&lt;BR /&gt;DROP TABLE LastSixMonthsMinClosingStock;&lt;BR /&gt;DROP FIELD DateFormatted;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 13:59:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Task/m-p/2413090#M13303</guid>
      <dc:creator>Bianchi</dc:creator>
      <dc:date>2024-01-31T13:59:25Z</dc:date>
    </item>
  </channel>
</rss>

