<?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: Max value from a specific table of a synthetic key in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Max-value-from-a-specific-table-of-a-synthetic-key/m-p/2091071#M89429</link>
    <description>&lt;P&gt;You need to include anything unique from the related table, for example a KPI and then the expression may look like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;max({&amp;lt; KPI = {'Sales'}&amp;gt;} date_key)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Beside this I suggest to remove the synthetic key by a different kind of data-model and not associating the fact-tables else by concatenating them. It's much simpler and avoids a lot of trouble - not only in regard to associate the various fact- and dim-tables else also by having missing key-values on both sides which isn't seldom.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;By concatenating the tables you should add an extra source-field which you could then use instead of the above mentioned KPI.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Another approach might be also to create a flag-field within the calendar, like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if(Date &amp;lt;= today(), 'past', 'future') as flag&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2023 12:14:07 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-07-06T12:14:07Z</dc:date>
    <item>
      <title>Max value from a specific table of a synthetic key</title>
      <link>https://community.qlik.com/t5/App-Development/Max-value-from-a-specific-table-of-a-synthetic-key/m-p/2091060#M89427</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a date field which is a synthetic key between my sales and my targets.&lt;/P&gt;
&lt;P&gt;Targets are known until end of year but sales are only on year to date basis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to know in a table per product the last time I sold the product so max(date_key)&lt;/P&gt;
&lt;P&gt;But I get 31/12 from the objective table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea how to specify the max from the sales table ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Matthieu&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 11:51:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-value-from-a-specific-table-of-a-synthetic-key/m-p/2091060#M89427</guid>
      <dc:creator>matthieu_k</dc:creator>
      <dc:date>2023-07-06T11:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Max value from a specific table of a synthetic key</title>
      <link>https://community.qlik.com/t5/App-Development/Max-value-from-a-specific-table-of-a-synthetic-key/m-p/2091071#M89429</link>
      <description>&lt;P&gt;You need to include anything unique from the related table, for example a KPI and then the expression may look like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;max({&amp;lt; KPI = {'Sales'}&amp;gt;} date_key)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Beside this I suggest to remove the synthetic key by a different kind of data-model and not associating the fact-tables else by concatenating them. It's much simpler and avoids a lot of trouble - not only in regard to associate the various fact- and dim-tables else also by having missing key-values on both sides which isn't seldom.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;By concatenating the tables you should add an extra source-field which you could then use instead of the above mentioned KPI.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Another approach might be also to create a flag-field within the calendar, like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if(Date &amp;lt;= today(), 'past', 'future') as flag&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 12:14:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-value-from-a-specific-table-of-a-synthetic-key/m-p/2091071#M89429</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-07-06T12:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Max value from a specific table of a synthetic key</title>
      <link>https://community.qlik.com/t5/App-Development/Max-value-from-a-specific-table-of-a-synthetic-key/m-p/2091073#M89430</link>
      <description>&lt;P&gt;Thanks Marcus for your quick reply.&lt;/P&gt;
&lt;P&gt;I will setup flag then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the key, I will refer your point to the expert in my team when he is back from holidays &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy your day,&lt;/P&gt;
&lt;P&gt;Matthieu&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 12:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-value-from-a-specific-table-of-a-synthetic-key/m-p/2091073#M89430</guid>
      <dc:creator>matthieu_k</dc:creator>
      <dc:date>2023-07-06T12:19:04Z</dc:date>
    </item>
  </channel>
</rss>

