<?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: Scripting + How to group expiry status - if there is one sub record is Expired, consider the Record as Expired. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291145#M403695</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this the result you want (4th column)?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/150331_1.png" style="height: 199px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Jan 2017 16:08:16 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2017-01-21T16:08:16Z</dc:date>
    <item>
      <title>Scripting + How to group expiry status - if there is one sub record is Expired, consider the Record as Expired.</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291142#M403692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this scernario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have such table as example. I have 2 groups - 1 is consider Expired Record 1 is Not Expired Record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each RecordID has more than 1 ActionID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is 1 recordID has 1 actionID which is Expired, that RECORDID will be considered as EXPIRED. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="334"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;RecordID&lt;/TD&gt;&lt;TD width="64"&gt;ActionID&lt;/TD&gt;&lt;TD width="142"&gt;Expiry_Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;12345&lt;/TD&gt;&lt;TD align="right"&gt;123&lt;/TD&gt;&lt;TD&gt;Expired&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;12345&lt;/TD&gt;&lt;TD align="right"&gt;456&lt;/TD&gt;&lt;TD&gt;Not Expired&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;12345&lt;/TD&gt;&lt;TD align="right"&gt;789&lt;/TD&gt;&lt;TD&gt;Not Expired&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dunno how to do from loading point of view. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if is from front end scripting point of view.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 11:55:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291142#M403692</guid>
      <dc:creator>jim_chan</dc:creator>
      <dc:date>2017-01-21T11:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting + How to group expiry status - if there is one sub record is Expired, consider the Record as Expired.</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291143#M403693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim, you can create a map with expired records and use applymap, the expired recordIds will get the status from the map, those wich are not in the map will keep their original status:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map_Status:&lt;/P&gt;&lt;P&gt;mapping LOAD RecordID, Expiry_Status&lt;/P&gt;&lt;P&gt;From/Resident... where Expiry_Status='Expired';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;LOAD RecordID, ActionID, &lt;SPAN style="font-size: 13.3333px;"&gt;Expiry_Status&lt;/SPAN&gt;, ApplyMap('Map_Status', RecordID, Expiry_Status) as RecordID_Expiry_Status&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;From/Resident...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 13:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291143#M403693</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2017-01-21T13:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting + How to group expiry status - if there is one sub record is Expired, consider the Record as Expired.</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291144#M403694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But my scenario is not like this. Do u mean I have to create another table to map? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table that full of records ID and action ID. But 1 record ID can have more than 1 action ID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so such recordID when it has 1 action ID with EXPIRY status,&amp;nbsp; this record ID will be counted as an Expired record..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 14:17:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291144#M403694</guid>
      <dc:creator>jim_chan</dc:creator>
      <dc:date>2017-01-21T14:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting + How to group expiry status - if there is one sub record is Expired, consider the Record as Expired.</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291145#M403695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this the result you want (4th column)?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/150331_1.png" style="height: 199px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 16:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291145#M403695</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-01-21T16:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting + How to group expiry status - if there is one sub record is Expired, consider the Record as Expired.</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291146#M403696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim, I'm not sure to understand the problem... mapping tables are deleted when the script ends, they are used only to assign values while loading. It was an example than using a map you can check if an RecordID is expired and assign the 'Expired' value to all the records with the same RecordID.&lt;/P&gt;&lt;P&gt;I set the value in another field to keep the original original status but it can be in the same field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can also be:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Map_Status:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;mapping&lt;/STRONG&gt; LOAD Distinct RecordID, 1 as Expired&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From/Resident... where Expiry_Status='Expired';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Final:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *, If(ApplyMap('Map_Status', RecordID), '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Expired&lt;/SPAN&gt;', &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Expiry_Status&lt;/SPAN&gt;) as RecordID_Expiry_Status&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;From/Resident...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;It has the backwards of having to load the distinct record ids in the map to check the expired&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Another option, if the only values are Expired and Not Expired, and you can load sorted by RecordID and Expiry_Status, doing the checks with peek():&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD ...&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek(RecordID)=RecordID and Peek(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Expiry_Status)='Expired', 'Expired', &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Expiry_Status&lt;/SPAN&gt;) as &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Expiry_Status &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 18:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-How-to-group-expiry-status-if-there-is-one-sub-record/m-p/1291146#M403696</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2017-01-21T18:03:44Z</dc:date>
    </item>
  </channel>
</rss>

