<?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: Getting String value from a Column depending on MAX function N in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281006#M401660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/146975"&gt;petter-s&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I'm astonished on how you approached the issue. I've never though of it and learned a few things on the way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance is more than fine, I was scared this would take several minutes to refresh, but only takes a few seconds with the real app data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the examples you provided, your time and ideas &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jan 2017 13:22:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-01-09T13:22:29Z</dc:date>
    <item>
      <title>Getting String value from a Column depending on MAX function N</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281001#M401655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Its been a hole day trying to figure this out, exhausted I requesting some help from you guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attachment for sample data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got a chart with Division, Metric as dimensions, now I need to replicate for 22 Columns (yes, I'm going crazy):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Date: First Column: is the last informed date from that Division and Metric&lt;/LI&gt;&lt;LI&gt;Status: Second Column: the status of date of the first column&lt;/LI&gt;&lt;LI&gt;Second Column Date:: the second last informed date&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Status: Second Column: the status of date of the Second column&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;and so on for 22...&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/148477_1.png" style="font-size: 13.3333px;" /&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;Well, what i have accomplished, basically nothing... for date column, i got it solve by using this expression:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;MAX(Date, N) which reflects the correct date regardless of the span of each Division Metric (Quartely, Monthly, Daily).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now... I'm going mad trying to get &lt;STRONG&gt;status&lt;/STRONG&gt;, I've tried Only, FirstSortedValue, Set analysis.... Can anyone of the community, just tell me.. &lt;STRONG&gt;dude, this is fairly obvious, you need to....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IMPORTANT CAN'T ALTER SCRIPT (damn&lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt; policies)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2017 18:12:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281001#M401655</guid>
      <dc:creator />
      <dc:date>2017-01-05T18:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting String value from a Column depending on MAX function N</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281002#M401656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also do it with a pivot table which is much easier but you can get an insane amount of columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have shown both approaches here and attached the example application:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2017-01-06 00_10_30-QlikView x64 - [C__Users_psd_Downloads_Pivot.qvw_].png" class="jive-image image-1" src="/legacyfs/online/148513_2017-01-06 00_10_30-QlikView x64 - [C__Users_psd_Downloads_Pivot.qvw_].png" style="height: 279px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2017 23:13:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281002#M401656</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2017-01-05T23:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting String value from a Column depending on MAX function N</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281003#M401657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Petter,&lt;/P&gt;&lt;P&gt;first, thanks for the replay. You are correct indeed, i also thought about a pivot table and using date as default column, and as you mention i get lots of dates. That approach wont work because I will get something like this:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="148631" alt="1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/148631_1.PNG" style="height: 62px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see, in Division1 Metric B, should show the last informed status of that metric as the first column (in the new sample data should be 01-12-2015). So pivot table is discarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other approach wont work either, cause I need to inform the &lt;STRONG&gt;last informed status of each Div-metric 22 times&lt;/STRONG&gt;. Using the snippet you provided I'll get something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="148632" alt="2.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/148632_2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Division1 Metric A is correctly displayed, but once again, metrics that don't have been informed more than 22 times wont show &lt;SPAN style="font-size: 13.3333px;"&gt; like Division1-Metric B&lt;/SPAN&gt;, there are some metrics that are yearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts in how to approach this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One again thanks for the replay, I really appreciate,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jan 2017 00:53:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281003#M401657</guid>
      <dc:creator />
      <dc:date>2017-01-07T00:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Getting String value from a Column depending on MAX function N</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281004#M401658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Yes Martin I do have some more suggestions for you:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;You can either use a descending sort in the &lt;EM style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;Concat( stats , '=' , &lt;SPAN style="color: #ff0000;"&gt;-&lt;/SPAN&gt;date1)&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; notice the minus in front of date1. This will get the concatenated string of stats to be in the reverse order and you can start picking from 1 and upwards.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;The other option would be to use a negative value in front of the element number you want to pick in the SubField-function. That way you start picking from the right and not the left. This is basically another way of doing what I suggested in the previous paragraph.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;So instead of having&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="font-family: 'courier new', courier;"&gt;Subfield( Concat( stats , '=' , date1) , '=' , 22 )&lt;/STRONG&gt; &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;you would have&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style=": ; font-size: 13.3333px; font-family: 'courier new', courier;"&gt;Subfield( Concat( stats , '=' , date1) , '=' , -1 )&amp;nbsp;&amp;nbsp; // Pick from the last one &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Lastly I still think that it would be possible to use a pivot table. Instead of using as a dimension the actual date you could have a sequence number for the dates as a dimension that follows the dates. For each div, metric and span you would get a running sequence of 1 to n for each date within each row. Then as a measure you could have a concatenated date with the stats in a string that could be shown in each cell. That would leave you with a table quite similar to the straight table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2017 00:34:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281004#M401658</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2017-01-08T00:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting String value from a Column depending on MAX function N</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281005#M401659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't resist the temptation to try out the last suggestion in my last answer myself - the one about using a PIVOT to achieve a compact table. It works fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="148665" alt="2017-01-08 01_58_46-QlikView x64 - [C__Users_psd_Downloads_Pivot.qvw_].png" class="jive-image image-1" src="/legacyfs/online/148665_2017-01-08 01_58_46-QlikView x64 - [C__Users_psd_Downloads_Pivot.qvw_].png" style="height: 167px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2017-01-08 02_21_57-QlikView x64 - [C__Users_psd_Downloads_Pivot2.qvw_].png" class="jive-image image-2" height="115" src="/legacyfs/online/148666_2017-01-08 02_21_57-QlikView x64 - [C__Users_psd_Downloads_Pivot2.qvw_].png" style="height: 115px; width: 1131.75px;" width="1132" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached two QVWs that shows the concept with both your datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2017 01:13:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281005#M401659</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2017-01-08T01:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting String value from a Column depending on MAX function N</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281006#M401660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/146975"&gt;petter-s&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I'm astonished on how you approached the issue. I've never though of it and learned a few things on the way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance is more than fine, I was scared this would take several minutes to refresh, but only takes a few seconds with the real app data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the examples you provided, your time and ideas &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 13:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-String-value-from-a-Column-depending-on-MAX-function-N/m-p/1281006#M401660</guid>
      <dc:creator />
      <dc:date>2017-01-09T13:22:29Z</dc:date>
    </item>
  </channel>
</rss>

