<?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: First Price Calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398245#M424247</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;SPAN style="color: #0000ff;"&gt;NODISTINCT&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(DISTINCT Unit_Price,data),Product) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Nov 2017 14:47:49 GMT</pubDate>
    <dc:creator>antoniotiman</dc:creator>
    <dc:date>2017-11-16T14:47:49Z</dc:date>
    <item>
      <title>First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398239#M424241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi at all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this situation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/183415_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;So i have several products and the date of purchase and the relative unit price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a field called "Prima data" where i select, for each product, the first date of purchased and then i would like to obtain, for each product, the price of purchased at the first date. The problem is that in the last column i used this formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(nodistinct avg({&amp;lt;data={"$(MinData)"}&amp;gt;}Unit_Price), Product)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it calc the unit price only for the first date of the entire data set (in this example was product A purchased at 01/01/2017 at 1,1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any solution in order to calc the first price for each product?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398239#M424241</guid>
      <dc:creator>andrea90casa</dc:creator>
      <dc:date>2017-11-15T16:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398240#M424242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share a sample file to look into?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:53:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398240#M424242</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2017-11-15T16:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398241#M424243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vishwarath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you are &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:55:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398241#M424243</guid>
      <dc:creator>andrea90casa</dc:creator>
      <dc:date>2017-11-15T16:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398242#M424244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this in your price min data &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Aggr(avg({&amp;lt; data = {"= Aggr( min(data), Product)" } &amp;gt; }Unit_Price), Product)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2017 17:14:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398242#M424244</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2017-11-15T17:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398243#M424245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Vish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried with min function and it works, then i tried to change min with max function but the result doesn't change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example for Product E i would like to see 1,2 as min data and 1,22 as max data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Aggr(avg({&amp;lt; data = {"= Aggr( min(data), Product)" } &amp;gt; }Unit_Price), Product)&lt;/P&gt;&lt;P&gt;= Aggr(avg({&amp;lt; data = {"= Aggr( max(data), Product)" } &amp;gt; }Unit_Price), Product)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:01:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398243#M424245</guid>
      <dc:creator>andrea90casa</dc:creator>
      <dc:date>2017-11-16T14:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398244#M424246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hi Andrea, Are you using the expression in the chart with the dimension Product? Then you can drop the aggregation on product within the Set analysis. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;= Aggr(ONLY({&amp;lt; data = {"$(=&amp;nbsp; MAX(data))" } &amp;gt; }Unit_Price), Product)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:22:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398244#M424246</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2017-11-16T14:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398245#M424247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;SPAN style="color: #0000ff;"&gt;NODISTINCT&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(DISTINCT Unit_Price,data),Product) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398245#M424247</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2017-11-16T14:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398246#M424248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks A.M.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works but when i select only one product (and it could be useful). But how can i do if i would like to obtain an aggregated result, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have list of product with first price and last price, and i have the total quantity of product purchased.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can create two purchased amount:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Price * Quantity&lt;/P&gt;&lt;P&gt;Last Price * Quantity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then i can subract the second term to the first in order to obtain a simulated saving for each product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it could be useful sum all these amount (for a specific category of purchase for example) and obtain a total saving for each category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But with only function i can't do that i supposed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:59:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398246#M424248</guid>
      <dc:creator>andrea90casa</dc:creator>
      <dc:date>2017-11-16T14:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398247#M424249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrea, &lt;/P&gt;&lt;P&gt;Are you able to update the script? In that case you can add the script below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset:&lt;/P&gt;&lt;P&gt;LOAD data, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Prodotto as Product, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Prezzo_Uni as Unit_Price,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Categoria as Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantità as Quantity,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Conto&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Foglio1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN LOAD &lt;/P&gt;&lt;P&gt;Product,&lt;/P&gt;&lt;P&gt;MIN(data) AS data,&lt;/P&gt;&lt;P&gt;1 AS IsFirstPrice&lt;/P&gt;&lt;P&gt;RESIDENT dataset&lt;/P&gt;&lt;P&gt;GROUP BY Product; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN LOAD &lt;/P&gt;&lt;P&gt;Product,&lt;/P&gt;&lt;P&gt;MAX(data) AS data,&lt;/P&gt;&lt;P&gt;1 AS IsLastPrice&lt;/P&gt;&lt;P&gt;RESIDENT dataset&lt;/P&gt;&lt;P&gt;GROUP BY Product; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 15:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398247#M424249</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2017-11-16T15:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398248#M424250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 15:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398248#M424250</guid>
      <dc:creator>andrea90casa</dc:creator>
      <dc:date>2017-11-16T15:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: First Price Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398249#M424251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;SPAN style="color: #0000ff;"&gt;NODISTINCT&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(DISTINCT Unit_Price,data),Product) &lt;/SPAN&gt;*Quantity&lt;/P&gt;&lt;P&gt;Last Price -&amp;gt; replace data with -data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 15:35:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-Price-Calculation/m-p/1398249#M424251</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2017-11-16T15:35:20Z</dc:date>
    </item>
  </channel>
</rss>

