<?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: Find a value when 2 dates match in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820166#M289130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone.&amp;nbsp; I actually went in a slightly different direction.&amp;nbsp; I'm curious what you think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually made a calculated dimension like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CLNDR_DT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AS_OF_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Metric&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems to be working for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2015 22:50:33 GMT</pubDate>
    <dc:creator>bronsonelliott</dc:creator>
    <dc:date>2015-02-03T22:50:33Z</dc:date>
    <item>
      <title>Find a value when 2 dates match</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820162#M289126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble figuring out the proper syntax for a formula and looking for some help.&amp;nbsp; In my data model, I have data that looks similar to below.&amp;nbsp; I have multiple metrics each one having different amounts of history (&lt;STRONG&gt;CLNDR_DT&lt;/STRONG&gt; column) as well as different timing of when the data was last refreshed (&lt;STRONG&gt;AS_OF_DATE&lt;/STRONG&gt; column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to do is display this data in a straight table but I want 1 line per metric and the value to be the Value where the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;CLNDR_DT = &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;AS_OF_DATE&lt;/STRONG&gt; as represented in the green rows below.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/77039_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the straight table would look something like this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/77040_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;I have tried the following formulas and I can't get them to do what I am wanting.&amp;nbsp; They seem to be looking at the max &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;AS_OF_DATE&lt;/STRONG&gt; for all metrics and not keeping it metric specific.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;sum({&amp;lt;CLNDR_DT = {AS_OF_DATE}&amp;gt;}&amp;nbsp; Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;sum({&amp;lt;CLNDR_DT = {Max(AS_OF_DATE)}&amp;gt;}&amp;nbsp; Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;CLNDR_DT = {"$(=Max(AS_OF_DATE))"}&amp;gt;}&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this was clear enough.&amp;nbsp; What am I missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 19:34:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820162#M289126</guid>
      <dc:creator>bronsonelliott</dc:creator>
      <dc:date>2015-02-03T19:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find a value when 2 dates match</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820163#M289127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using if():&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.33px;"&gt;sum(if(floor(CLNDR_DT) = floor(AS_OF_DATE), Value))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.33px;"&gt;(I added floor() here in case the dates are actually timestamps)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 21:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820163#M289127</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-03T21:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Find a value when 2 dates match</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820164#M289128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;- Value / (not CLNDR_DR-AS_OF_DATE)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 21:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820164#M289128</guid>
      <dc:creator>jonasheisterkam</dc:creator>
      <dc:date>2015-02-03T21:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find a value when 2 dates match</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820165#M289129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Playing off what others have suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=sum(Value * (CLNDR_DT = AS_OF_DATE) * -1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=sum({&amp;lt;CLNDR_DT={"=CLNDR_DT=AS_OF_DATE"}&amp;gt;}Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's always the highest CLNDR_DT rows you want for each Metric:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=FirstSortedValue(Value, - CLNDR_DT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com" rel="nofollow"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 22:45:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820165#M289129</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-02-03T22:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find a value when 2 dates match</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820166#M289130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone.&amp;nbsp; I actually went in a slightly different direction.&amp;nbsp; I'm curious what you think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually made a calculated dimension like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CLNDR_DT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AS_OF_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Metric&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems to be working for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 22:50:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820166#M289130</guid>
      <dc:creator>bronsonelliott</dc:creator>
      <dc:date>2015-02-03T22:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Find a value when 2 dates match</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820167#M289131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting. I would not have thought of that one. The only downside I can see is if you want to add another expression that processes multiple rows, like Avg(Value). But it actually makes it easier to add other dimension values from the same row. So that's a plus.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad you got it working and contributed to your own question!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 23:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820167#M289131</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-02-03T23:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find a value when 2 dates match</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820168#M289132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is fine.&amp;nbsp; In fact I typically recommend calculated dimensions if there are multiple expressions in chart (see my post here &lt;A _jive_internal="true" href="https://community.qlik.com/thread/150574"&gt;http://community.qlik.com/thread/150574&lt;/A&gt;).&amp;nbsp; If there is only one, I'd rather change the expression.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 14:22:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-value-when-2-dates-match/m-p/820168#M289132</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-04T14:22:10Z</dc:date>
    </item>
  </channel>
</rss>

