<?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: Aggr problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-problem/m-p/571247#M212864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mickael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could to use the intervalmatch() function in your script to match the passengers journeys to the date range given in the TVA per country and date example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function will create a link table between your&amp;nbsp; table_centrale and Tva (with dates table) that only links when the passendger journey date is within the timeframe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;intervalmatch (SegmentSTD) Load start_Date, End_date resident tva;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creates a link table between the two&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Feb 2014 13:55:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-26T13:55:26Z</dc:date>
    <item>
      <title>Aggr problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-problem/m-p/571246#M212863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi QlikView community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got a problem with Aggr using.&lt;/P&gt;&lt;P&gt;I link to this mail a QVW example and this is some informations about this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got 3 sources : TVA, TVA per distance, and a central table with some value and a date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;TVA give me informations about a TVA value depending of Country / Start Date and End Date.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//TVA per country and date, example&lt;/P&gt;&lt;P&gt;// Country&amp;nbsp; TVA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end date&lt;/P&gt;&lt;P&gt;// France&amp;nbsp;&amp;nbsp; 10%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2010&amp;nbsp; 01/01/2013&lt;/P&gt;&lt;P&gt;// France&amp;nbsp;&amp;nbsp;&amp;nbsp; 7%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2013&amp;nbsp; 01/01/2015&lt;/P&gt;&lt;P&gt;// Belgium&amp;nbsp;&amp;nbsp; 6%&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2010&amp;nbsp; 01/01/2015&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;TVA per distance give me a % depending of a country and a journey.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Example, % by country of a journey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// IDStation&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country&amp;nbsp;&amp;nbsp;&amp;nbsp; TVAShare&lt;/P&gt;&lt;P&gt;// Paris - Brussels&amp;nbsp;&amp;nbsp;&amp;nbsp; France&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 70%&lt;/P&gt;&lt;P&gt;//&amp;nbsp; Paris - Brussels&amp;nbsp;&amp;nbsp; Belgium&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30%&lt;/P&gt;&lt;P&gt;//&amp;nbsp; Berlin - Brussels&amp;nbsp; Germany&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30%&lt;/P&gt;&lt;P&gt;//&amp;nbsp; Berlin - Brussels&amp;nbsp; Netherland&amp;nbsp;&amp;nbsp; 30%&lt;/P&gt;&lt;P&gt;//&amp;nbsp; Berlin - Brussels&amp;nbsp; Belgium&amp;nbsp;&amp;nbsp;&amp;nbsp; 40%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Central table give me an amount payed by different passenger for a journey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Example&lt;/P&gt;&lt;P&gt;// Passenger&amp;nbsp;&amp;nbsp;&amp;nbsp; IDstation&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SegmentSTD&amp;nbsp;&amp;nbsp;&amp;nbsp; CA_transport_PAX&amp;nbsp; &lt;/P&gt;&lt;P&gt;// 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Berlin - Brussels&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/04/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 120&lt;/P&gt;&lt;P&gt;// 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Paris - Brussels&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 07/04/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 99&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My goal is to calculate, per Country, a sum of this amounted * % per country * TVA value where my value date is between the start date and the end date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's OK when build a table with all date and TVA informations,&lt;/P&gt;&lt;P&gt;but it is not when my analyse have only country dimension.&lt;/P&gt;&lt;P&gt;I try to use this kind of expression, but without success :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if((SegmentSTD)&amp;gt;(START_DATE) and (SegmentSTD)&amp;lt;(END_DATE), sum(aggr(sum(CA_transport_Pax)*TVA....,CountryCode,IDstation,START_DATE,END_DATE)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Country&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amout&lt;/P&gt;&lt;P&gt;//Belgique 120 euros *TVA_share (40% of Berlin Brussels ) * TVA (6%)&amp;nbsp;&amp;nbsp;&amp;nbsp; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 99 euros *TVA_share (30% of Paris Brussels ) * TVA (6%)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I give some explications in the script of the example, with extract of the table and goal waiting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Mickaël.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 10:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-problem/m-p/571246#M212863</guid>
      <dc:creator />
      <dc:date>2014-02-26T10:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-problem/m-p/571247#M212864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mickael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could to use the intervalmatch() function in your script to match the passengers journeys to the date range given in the TVA per country and date example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function will create a link table between your&amp;nbsp; table_centrale and Tva (with dates table) that only links when the passendger journey date is within the timeframe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;intervalmatch (SegmentSTD) Load start_Date, End_date resident tva;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creates a link table between the two&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 13:55:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-problem/m-p/571247#M212864</guid>
      <dc:creator />
      <dc:date>2014-02-26T13:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-problem/m-p/571248#M212865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once you've done this of course, the expression will be easy in the application in QV. You would literally just * the items together, instead of needing complicated if statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=TVA_VALUE*TVA_SHARE*ca_transporT_pax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 13:57:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-problem/m-p/571248#M212865</guid>
      <dc:creator />
      <dc:date>2014-02-26T13:57:00Z</dc:date>
    </item>
  </channel>
</rss>

