<?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: Logic to load data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229975#M391986</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might either load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;tabTransactions&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Code=6220 or Peek(TansactID),RangeSum(Peek(TansactID),-(Code=6220))) as TansactID;&lt;/P&gt;&lt;P&gt;LOAD Left([@1:n],4) as Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trim(Mid([@1:n],5)) as Data&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="264516" data-objecttype="13" href="https://community.qlik.com/servlet/JiveServlet/download/2051-249020-1208054-264516/test+%282%29.txt"&gt;https://community.qlik.com/servlet/JiveServlet/download/1208054-264516/test%20(2).txt&lt;/A&gt;&lt;SPAN&gt;] (fix, codepage is 1252)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Where Len(Trim([@1:n]));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_249020_Pic2.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152513_QlikCommunity_Thread_249020_Pic2.JPG" style="height: 33px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use a pivot table to present your data, or generate separate fields for each code using a generic load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabTemp:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Code=6220 or Peek(TansactID),RangeSum(Peek(TansactID),-(Code=6220))) as TansactID;&lt;/P&gt;&lt;P&gt;LOAD Left([@1:n],4) as Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trim(Mid([@1:n],5)) as Data&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="264516" data-objecttype="13" href="https://community.qlik.com/servlet/JiveServlet/download/2051-249020-1208054-264516/test+%282%29.txt"&gt;https://community.qlik.com/servlet/JiveServlet/download/1208054-264516/test%20(2).txt&lt;/A&gt;&lt;SPAN&gt;] (fix, codepage is 1252)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Where Len(Trim([@1:n]));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabTransactions:&lt;/P&gt;&lt;P&gt;Generic&lt;/P&gt;&lt;P&gt;LOAD TansactID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Code'&amp;amp;Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data&lt;/P&gt;&lt;P&gt;Resident tabTemp&lt;/P&gt;&lt;P&gt;Where TansactID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_249020_Pic1.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/152514_QlikCommunity_Thread_249020_Pic1.JPG" style="height: 43px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2017 23:29:24 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2017-02-08T23:29:24Z</dc:date>
    <item>
      <title>Logic to load data</title>
      <link>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229974#M391985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help in loading data from .txt file.&lt;/P&gt;&lt;P&gt;Data will be in below format..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;P&gt;6200AKFJKFJ KSFJSKJFKFJFJ&lt;/P&gt;&lt;P&gt;6220FJDS FJDSKFJSFJDSKJFDKSJF&lt;/P&gt;&lt;P&gt;6221&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ERIWURIEU REIRUIWERUEWORUW&lt;/P&gt;&lt;P&gt;6222AWEUIDFUIFU UFDSIFU&lt;/P&gt;&lt;P&gt;6229QUYERUREYURYUR IEWRUIEW&lt;/P&gt;&lt;P&gt;6230CXNMVNVVN MVNZMN&lt;/P&gt;&lt;P&gt;6220XMNVXMZN XNVCXMVNXCMVNMXCNV&lt;/P&gt;&lt;P&gt;6221EWURIWERU IERUQUR&lt;/P&gt;&lt;P&gt;6223 LJLKJKJJ ASDFSK&lt;/P&gt;&lt;P&gt;6231EIUWRIUEWRI EIRUEWIRUEIWRUIEWUR&lt;/P&gt;&lt;P&gt;6220 YUOIUHJH KSFHSFHS&lt;/P&gt;&lt;P&gt;6221&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SJKDFSKJFSKFJSKFJ FJDSKFJ&lt;/P&gt;&lt;P&gt;6225EYRTWEYRTWY REYRTEWYRTEWY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: &lt;/P&gt;&lt;P&gt;1. Every transaction starts with 6220. So, data between first 6220 to second 6220 is a single transaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ex: 6220FJDS FJDSKFJSFJDSKJFDKSJF@6221&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ERIWURIEU REIRUIWERUEWORUW@6222AWEUIDFUIFU UFDSIFU@6229QUYERUREYURYUR IEWRUIEW@6230CXNMVNVVN MVNZMN&lt;/P&gt;&lt;P&gt;2. In every transaction 6220 and 6221 is common.&lt;/P&gt;&lt;P&gt;3. After 6221 there is no consistency in next coming value. But it will be ascending order only(i.e. 6222 or 6228).&lt;/P&gt;&lt;P&gt;4. The transaction will start with 6220 but not sure with what value it will end.&lt;/P&gt;&lt;P&gt;5. Each transaction can be in 'n' number of lines.&lt;/P&gt;&lt;P&gt;6. Every number(i.e. 6220, 6221, 6222 etc) has it's own bites to split the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 911px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;Field1&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="86"&gt;Field2&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field3&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="76"&gt;Field4&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field5&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="45"&gt;Field6&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field7&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field8&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field9&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field10&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field11&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field12&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field13&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Field14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;6220&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;FJDSFJDSKFJ&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6221&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;ERIWURIEU&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6222&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;AWEU&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6229&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;QUYERUR&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6230&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;CXNMVN&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;6220&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;XMNVXM&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6221&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;EWURIWERU&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6223&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;LJLKJKJJ&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6231&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;EIUWRIUEWRI&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find attached sample file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sravan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 18:07:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229974#M391985</guid>
      <dc:creator>sravan_v007</dc:creator>
      <dc:date>2017-02-07T18:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to load data</title>
      <link>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229975#M391986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might either load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;tabTransactions&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Code=6220 or Peek(TansactID),RangeSum(Peek(TansactID),-(Code=6220))) as TansactID;&lt;/P&gt;&lt;P&gt;LOAD Left([@1:n],4) as Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trim(Mid([@1:n],5)) as Data&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="264516" data-objecttype="13" href="https://community.qlik.com/servlet/JiveServlet/download/2051-249020-1208054-264516/test+%282%29.txt"&gt;https://community.qlik.com/servlet/JiveServlet/download/1208054-264516/test%20(2).txt&lt;/A&gt;&lt;SPAN&gt;] (fix, codepage is 1252)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Where Len(Trim([@1:n]));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_249020_Pic2.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152513_QlikCommunity_Thread_249020_Pic2.JPG" style="height: 33px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use a pivot table to present your data, or generate separate fields for each code using a generic load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabTemp:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Code=6220 or Peek(TansactID),RangeSum(Peek(TansactID),-(Code=6220))) as TansactID;&lt;/P&gt;&lt;P&gt;LOAD Left([@1:n],4) as Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trim(Mid([@1:n],5)) as Data&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="264516" data-objecttype="13" href="https://community.qlik.com/servlet/JiveServlet/download/2051-249020-1208054-264516/test+%282%29.txt"&gt;https://community.qlik.com/servlet/JiveServlet/download/1208054-264516/test%20(2).txt&lt;/A&gt;&lt;SPAN&gt;] (fix, codepage is 1252)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Where Len(Trim([@1:n]));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabTransactions:&lt;/P&gt;&lt;P&gt;Generic&lt;/P&gt;&lt;P&gt;LOAD TansactID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Code'&amp;amp;Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data&lt;/P&gt;&lt;P&gt;Resident tabTemp&lt;/P&gt;&lt;P&gt;Where TansactID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_249020_Pic1.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/152514_QlikCommunity_Thread_249020_Pic1.JPG" style="height: 43px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 23:29:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229975#M391986</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2017-02-08T23:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to load data</title>
      <link>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229976#M391987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marco, it solved my issue. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sravan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 06:10:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229976#M391987</guid>
      <dc:creator>sravan_v007</dc:creator>
      <dc:date>2017-02-09T06:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Logic to load data</title>
      <link>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229977#M391988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;Please close your thread by marking a correct answer if your question is answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 06:37:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Logic-to-load-data/m-p/1229977#M391988</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2017-02-09T06:37:36Z</dc:date>
    </item>
  </channel>
</rss>

