<?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: Last prices before date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801114#M1211693</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/139625"&gt;@pcservicios&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want avg the price, try like below&lt;/P&gt;&lt;P&gt;=Avg(Aggr(if (DatePurchases=Date(max(Total&amp;lt;CodSaleProduct&amp;gt;if(DatePurchases&amp;lt;=Date($(vDateStart), 'DD/MM/YYYY') ,DatePurchases))), PricePurchases), DatePurchases, CodSaleProduct))&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 01:14:44 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2021-04-21T01:14:44Z</dc:date>
    <item>
      <title>Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1800467#M1211638</link>
      <description>&lt;P&gt;Hello, I need help for a sales report.&lt;/P&gt;&lt;P&gt;This report is an example to explain my problem.&lt;/P&gt;&lt;P&gt;I have some products that are sold and others that are bought. They are not the same product. For example when I buy beer, I buy a barrel, but when I sell beer, I sell a jug. They are different product codes. I have a table to relate both products.&lt;/P&gt;&lt;P&gt;The report gives me the sales between the 2 selection dates, and what I need to find the price at which a product was purchased before the selected dates.&lt;/P&gt;&lt;P&gt;In the example, in May I sold 7 beer jar, but the last barrel of beer I bought in March and I need to get that price.&amp;nbsp;I managed to get the date of the last purchase, but I can't get the price. In the example the price should be 45. And if I choose february the price should be 40.&lt;/P&gt;&lt;P&gt;Any help will be appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 12:07:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1800467#M1211638</guid>
      <dc:creator>pcservicios</dc:creator>
      <dc:date>2021-04-19T12:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1800738#M1211654</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/139625"&gt;@pcservicios&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;=Aggr(if (DatePurchases=Date(max(Total&amp;lt;CodSaleProduct&amp;gt;if(DatePurchases&amp;lt;=Date($(vDateStart), 'DD/MM/YYYY') ,DatePurchases))), PricePurchases), DatePurchases, CodSaleProduct)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 01:07:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1800738#M1211654</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-04-20T01:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1800888#M1211674</link>
      <description>&lt;P&gt;&amp;nbsp;A lot of thanks Mayil.&amp;nbsp; the formula works well, but if I have 2 or more purchases of an item on the same day it no longer works. In this case I need average price.&lt;/P&gt;&lt;P&gt;I upload a new version with this case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 10:52:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1800888#M1211674</guid>
      <dc:creator>pcservicios</dc:creator>
      <dc:date>2021-04-20T10:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801114#M1211693</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/139625"&gt;@pcservicios&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want avg the price, try like below&lt;/P&gt;&lt;P&gt;=Avg(Aggr(if (DatePurchases=Date(max(Total&amp;lt;CodSaleProduct&amp;gt;if(DatePurchases&amp;lt;=Date($(vDateStart), 'DD/MM/YYYY') ,DatePurchases))), PricePurchases), DatePurchases, CodSaleProduct))&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 01:14:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801114#M1211693</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-04-21T01:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801180#M1211701</link>
      <description>&lt;P&gt;Hi MayiVahanan.&lt;/P&gt;&lt;P&gt;Thank again, but the problem isn't calculate avg price. I think version 2 of the report was not uploaded. The problem is when there are 2 or more purchases on the same day and the same product.&lt;/P&gt;&lt;P&gt;In test v2.qvw I added to purchase table this data:&lt;/P&gt;&lt;P&gt;01/03/20,30,1,43&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 07:52:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801180#M1211701</guid>
      <dc:creator>pcservicios</dc:creator>
      <dc:date>2021-04-21T07:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801190#M1211702</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/139625"&gt;@pcservicios&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=Aggr(if (DatePurchases=Date(max(Total&amp;lt;CodSaleProduct&amp;gt;if(DatePurchases&amp;lt;=Date($(vDateStart), 'DD/MM/YYYY') ,DatePurchases))),&lt;STRONG&gt; Sum(PricePurchases)&lt;/STRONG&gt;), DatePurchases, CodSaleProduct)&lt;/P&gt;&lt;P&gt;Instead of sum(), based on ur requirement, you can change the exp&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 08:33:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801190#M1211702</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-04-21T08:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801197#M1211704</link>
      <description>&lt;P&gt;Hi again,&amp;nbsp; sorry for the inconvenience.&lt;/P&gt;&lt;P&gt;Have you tried the formula in the test v2.qvw report?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I understand that with sum it should give 88 and with avg it should give 44, but after chage the formula, but is not working like you can see on image.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A lot of thanks again&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 08:54:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801197#M1211704</guid>
      <dc:creator>pcservicios</dc:creator>
      <dc:date>2021-04-21T08:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801204#M1211705</link>
      <description>&lt;P&gt;Same formula working fine&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MayilVahanan_0-1618996044142.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/53341i5C35EBC553E93B9F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MayilVahanan_0-1618996044142.png" alt="MayilVahanan_0-1618996044142.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 09:07:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801204#M1211705</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-04-21T09:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801207#M1211706</link>
      <description>&lt;P&gt;Are you working with test v2.qvw? this report have extra data with one purchase on same date. And my problem is there.&lt;/P&gt;&lt;P&gt;I think your example is with the first version of the report, sorry.&lt;/P&gt;&lt;P&gt;Please donwload test v2.qvw, and try with it, thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 09:16:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801207#M1211706</guid>
      <dc:creator>pcservicios</dc:creator>
      <dc:date>2021-04-21T09:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801238#M1211707</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Are you send the correct file?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 10:08:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801238#M1211707</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-04-21T10:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Last prices before date</title>
      <link>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801639#M1211747</link>
      <description>&lt;P&gt;Hi Mayil, I don't know what happend.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have downloaded your file and everything works fine. But in mine I copy the same formula and it doesn't work. I do not get it.&lt;BR /&gt;I have also tried to copy the table from one report to another and the data does not come out :-(.&lt;/P&gt;&lt;P&gt;It is very rare.&amp;nbsp;I'm going to make up what's going on. Thank you very much for your help&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 08:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-prices-before-date/m-p/1801639#M1211747</guid>
      <dc:creator>pcservicios</dc:creator>
      <dc:date>2021-04-22T08:24:27Z</dc:date>
    </item>
  </channel>
</rss>

