<?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 Calculation Min Date in the Sum expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1625770#M456345</link>
    <description>&lt;P&gt;Hi Experts!&lt;/P&gt;&lt;P&gt;I've just faced with the problem of the following calculation:&lt;/P&gt;&lt;P&gt;I the sample data model i have two non-linked table (it's the idea of this task and they shouldn't be related).&lt;/P&gt;&lt;P&gt;First table:&lt;/P&gt;&lt;P&gt;MainDate&lt;/P&gt;&lt;P&gt;Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second Table:&lt;/P&gt;&lt;P&gt;FXDate&lt;/P&gt;&lt;P&gt;FXRate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the pivot table i have the calculated WeekStart dimension based on the MainDate and i am calculating the Rates on those WeekStart days using the following expression:&lt;/P&gt;&lt;P&gt;=sum(IF(MainDate=FXDate, FXRate))&lt;/P&gt;&lt;P&gt;The problem is, that this expression is calculating the sum of 7 records from the FXRate table, but i need to take only the min date of each week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=sum(IF(Min(MainDate)=FXDate, FXRate)) does not work, as it uses the nested min function, which should be aggregared.&lt;/P&gt;&lt;P&gt;The expected result - to fetch the FXRates per each WeekStart dates via the set analysis update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would be grateful for each idea!&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 13:32:39 GMT</pubDate>
    <dc:creator>AndreyShepel91</dc:creator>
    <dc:date>2019-09-19T13:32:39Z</dc:date>
    <item>
      <title>Calculation Min Date in the Sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1625770#M456345</link>
      <description>&lt;P&gt;Hi Experts!&lt;/P&gt;&lt;P&gt;I've just faced with the problem of the following calculation:&lt;/P&gt;&lt;P&gt;I the sample data model i have two non-linked table (it's the idea of this task and they shouldn't be related).&lt;/P&gt;&lt;P&gt;First table:&lt;/P&gt;&lt;P&gt;MainDate&lt;/P&gt;&lt;P&gt;Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second Table:&lt;/P&gt;&lt;P&gt;FXDate&lt;/P&gt;&lt;P&gt;FXRate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the pivot table i have the calculated WeekStart dimension based on the MainDate and i am calculating the Rates on those WeekStart days using the following expression:&lt;/P&gt;&lt;P&gt;=sum(IF(MainDate=FXDate, FXRate))&lt;/P&gt;&lt;P&gt;The problem is, that this expression is calculating the sum of 7 records from the FXRate table, but i need to take only the min date of each week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=sum(IF(Min(MainDate)=FXDate, FXRate)) does not work, as it uses the nested min function, which should be aggregared.&lt;/P&gt;&lt;P&gt;The expected result - to fetch the FXRates per each WeekStart dates via the set analysis update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would be grateful for each idea!&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 13:32:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1625770#M456345</guid>
      <dc:creator>AndreyShepel91</dc:creator>
      <dc:date>2019-09-19T13:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Min Date in the Sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1625883#M456346</link>
      <description>&lt;P&gt;I think I understand what you are trying to accomplish.&amp;nbsp; Because the dates to actually relate, you don't want to link the tables.&amp;nbsp; Makes sense.&amp;nbsp; I think you have two options here.&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Use a Calendar table and link the dates from each table to the calendar.&amp;nbsp; With a Calendar table, you can create a Weekstart() field, and by keying your Main Date and FX Date to the Calendar, your dates will bee associated appropriately.&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Concatenate the two tables and label the date fields the same name, so you can select values accordingly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Personally, I would try and make the calendar work.&amp;nbsp; I like Calendar tables, because they are very robust.&amp;nbsp; However, for the sake of simplicity, I have concatenated your two tables together and uploaded the app.&amp;nbsp; Take a look and see if this meets your needs.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nate&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 16:14:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1625883#M456346</guid>
      <dc:creator>hallquist_nate</dc:creator>
      <dc:date>2019-09-19T16:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Min Date in the Sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1625915#M456347</link>
      <description>&lt;P&gt;Is this what you are looking to get?&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/19615iCD4BFA4B9E9463FC/image-size/large?v=1.0&amp;amp;px=-1" border="0" width="331" height="322" title="image.png" alt="image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 17:16:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1625915#M456347</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-09-19T17:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Min Date in the Sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1626005#M456348</link>
      <description>&lt;P&gt;Thanks, Sunny!&lt;BR /&gt;Your solution works perfectly, but it's still applicable when changing the field value in the script.&lt;/P&gt;&lt;P&gt;I am looking for some other solution with the set analysis update only, meaning data mode/script logic stay the same.&lt;/P&gt;&lt;P&gt;Thanks for your feedback!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 21:37:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1626005#M456348</guid>
      <dc:creator>AndreyShepel91</dc:creator>
      <dc:date>2019-09-19T21:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Min Date in the Sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1626007#M456349</link>
      <description>&lt;P&gt;Thank you for your advice!&lt;BR /&gt;I agree with you on the advantages of using Calendar tables, but this is the really specific cases which needs no changes in the data model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to solve the issue using the set analysis only.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 21:48:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1626007#M456349</guid>
      <dc:creator>AndreyShepel91</dc:creator>
      <dc:date>2019-09-19T21:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Min Date in the Sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1626246#M456350</link>
      <description>&lt;P&gt;If you don't want your expression to change based on selection, you can try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Sum({1} If(WeekStartMainDate = FXDate, FXRate))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/19697iF6EEAE2EDCD3AF0E/image-size/large?v=1.0&amp;amp;px=-1" border="0" width="369" height="455" title="image.png" alt="image.png" /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 11:21:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1626246#M456350</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-09-20T11:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Min Date in the Sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1629768#M456351</link>
      <description>&lt;P&gt;Andrey, did Sunny's last post get you what you wanted?&amp;nbsp; If so, please be sure to use the Accept as Solution button on that post to give him credit for the assist and let everyone else know that worked for you.&amp;nbsp; If you did something else, consider posting that and then mark that as the solution, and if you are still working on things, leave an update for everyone.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 20:45:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-Min-Date-in-the-Sum-expression/m-p/1629768#M456351</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-09-30T20:45:24Z</dc:date>
    </item>
  </channel>
</rss>

