<?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 How to pick first row for each key values and store separately ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726812#M591855</link>
    <description>&lt;P&gt;Hi All ,&lt;BR /&gt;&lt;BR /&gt;What should be the script&amp;nbsp; to pick&amp;nbsp; any first row for each key values and store separately in QVD .&lt;BR /&gt;&lt;BR /&gt;Sample data with expected output below :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FIRST ROW.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37282iEEDF6B74ED7504C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="FIRST ROW.PNG" alt="FIRST ROW.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;&lt;BR /&gt;Key, M1, M2, LOC, RATIO, DIM&lt;BR /&gt;K1, 8, 3, E, 4:3, A&lt;BR /&gt;K1, 2, 4, W, 4:4, B&lt;BR /&gt;K1, 7, 10, N, 4:5, A&lt;BR /&gt;K1, 11, 9, S, 4:6, C&lt;BR /&gt;K2, 3, 1, S, 4:7, D&lt;BR /&gt;K3, 5, 4, E, 4:8, D&lt;BR /&gt;K3, 6, 5, E, 4:9, M&lt;BR /&gt;K3, 1, 1, S, 4:10, O&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Thank You .&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 12:56:46 GMT</pubDate>
    <dc:creator>shekhar_analyti</dc:creator>
    <dc:date>2020-07-10T12:56:46Z</dc:date>
    <item>
      <title>How to pick first row for each key values and store separately ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726812#M591855</link>
      <description>&lt;P&gt;Hi All ,&lt;BR /&gt;&lt;BR /&gt;What should be the script&amp;nbsp; to pick&amp;nbsp; any first row for each key values and store separately in QVD .&lt;BR /&gt;&lt;BR /&gt;Sample data with expected output below :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FIRST ROW.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37282iEEDF6B74ED7504C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="FIRST ROW.PNG" alt="FIRST ROW.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;&lt;BR /&gt;Key, M1, M2, LOC, RATIO, DIM&lt;BR /&gt;K1, 8, 3, E, 4:3, A&lt;BR /&gt;K1, 2, 4, W, 4:4, B&lt;BR /&gt;K1, 7, 10, N, 4:5, A&lt;BR /&gt;K1, 11, 9, S, 4:6, C&lt;BR /&gt;K2, 3, 1, S, 4:7, D&lt;BR /&gt;K3, 5, 4, E, 4:8, D&lt;BR /&gt;K3, 6, 5, E, 4:9, M&lt;BR /&gt;K3, 1, 1, S, 4:10, O&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Thank You .&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 12:56:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726812#M591855</guid>
      <dc:creator>shekhar_analyti</dc:creator>
      <dc:date>2020-07-10T12:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to pick first row for each key values and store separately ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726815#M591856</link>
      <description>&lt;P&gt;Hello Sunny Bhai&amp;nbsp;&lt;BR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:02:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726815#M591856</guid>
      <dc:creator>shekhar_analyti</dc:creator>
      <dc:date>2020-07-10T13:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to pick first row for each key values and store separately ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726819#M591857</link>
      <description>&lt;P&gt;Data:&lt;BR /&gt;Load *, If(Previous(Key)=Key, 1,0) as KC&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Key, M1, M2, LOC, RATIO, DIM&lt;BR /&gt;K1, 8, 3, E, 4:3, A&lt;BR /&gt;K1, 2, 4, W, 4:4, B&lt;BR /&gt;K1, 7, 10, N, 4:5, A&lt;BR /&gt;K1, 11, 9, S, 4:6, C&lt;BR /&gt;K2, 3, 1, S, 4:7, D&lt;BR /&gt;K3, 5, 4, E, 4:8, D&lt;BR /&gt;K3, 6, 5, E, 4:9, M&lt;BR /&gt;K3, 1, 1, S, 4:10, O&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FirstRowData:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD Key, M1, M2, LOC, RATIO, DIM&lt;BR /&gt;Resident Data where KC =0 ;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:11:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726819#M591857</guid>
      <dc:creator>skamath1</dc:creator>
      <dc:date>2020-07-10T13:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to pick first row for each key values and store separately ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726824#M591858</link>
      <description>&lt;P&gt;you many need to use order by to order your data first so that peek and previous function can work as expected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Data:
LOAD * INLINE [
Key, M1, M2, LOC, RATIO, DIM
K1, 8, 3, E, 4:3, A
K1, 2, 4, W, 4:4, B
K1, 7, 10, N, 4:5, A
K1, 11, 9, S, 4:6, C
K2, 3, 1, S, 4:7, D
K3, 5, 4, E, 4:8, D
K3, 6, 5, E, 4:9, M
K3, 1, 1, S, 4:10, O
];

Final:
load *
where Flag=1;
load *,
     if(peek(Key)&amp;lt;&amp;gt;Key,1,0) as Flag
resident Data
order by Key;

drop table Data;

Store Final Into ...............;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:22:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726824#M591858</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-07-10T13:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to pick first row for each key values and store separately ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726878#M591859</link>
      <description>&lt;P&gt;One more option&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD * INLINE [
    Key, M1, M2, LOC, RATIO, DIM
    K1, 8, 3, E, 4:3, A
    K1, 2, 4, W, 4:4, B
    K1, 7, 10, N, 4:5, A
    K1, 11, 9, S, 4:6, C
    K2, 3, 1, S, 4:7, D
    K3, 5, 4, E, 4:8, D
    K3, 6, 5, E, 4:9, M
    K3, 1, 1, S, 4:10, O
] Where not Exists(Key);&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:06:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pick-first-row-for-each-key-values-and-store-separately/m-p/1726878#M591859</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-07-10T15:06:22Z</dc:date>
    </item>
  </channel>
</rss>

