<?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: Subfield Challenge in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1599963#M44342</link>
    <description>&lt;P&gt;I think the following will be helpful for you:&lt;/P&gt;&lt;P&gt;load *, rowno() as RowNo;&lt;BR /&gt;load *, if(Counter = 1, 'Sub-ID', CategoryT) as Category, if(Counter = 1, CategoryT, ValueT) as Value;&lt;BR /&gt;load *, subfield(Lines, ':', 1) as CategoryT, subfield(Lines, ':', 2) as ValueT, mod(IterNo, 4) as Counter;&lt;BR /&gt;load *, subfield([Detail Entries], chr(10), iterno()) as Lines, iterno() as IterNo&lt;BR /&gt;&amp;nbsp;&amp;nbsp; while iterno() &amp;lt;= substringcount([Detail Entries], chr(10)) + 1;&lt;BR /&gt;load [Purchase-Line], [Detail Entries], recno() as RecNo&lt;BR /&gt;from [Subfield-Challenge td-p 1599919.xlsx] (ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="subfield.JPG"&gt;&lt;img src="https://community.qlik.com/skins/images/F8B11FBB1963C3F5190A68D84129B237/responsive_peak/images/image_not_found.png" alt="subfield.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you really need to create multiple fields from Category and Value you could use a generic load, multiple loads with appropriate where-clauses to join them together or some further extendings/adjustments in the above matching with interrecord-functions to bring the various values into one record and deleting the unapproriate ones afterwards.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2019 14:19:55 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-07-08T14:19:55Z</dc:date>
    <item>
      <title>Subfield Challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1599919#M44340</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I have a table to read like this :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DetailEntry1.png" style="width: 295px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15061iD457A1F949E2C44A/image-size/large?v=v2&amp;amp;px=999" role="button" title="DetailEntry1.png" alt="DetailEntry1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And I'd like to have a final result table like this :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DetailEntry2.png" style="width: 560px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15064iAC922260C3A2089F/image-size/large?v=v2&amp;amp;px=999" role="button" title="DetailEntry2.png" alt="DetailEntry2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've been trying a lot of combinations with subfield() function to get my desired result, but I can't make it right. Anybody knows how can I do that?&lt;/P&gt;&lt;P&gt;I've attached an excel sample of my problem if someone can give it a try &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best regards, Marcel.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:30:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1599919#M44340</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2024-11-16T20:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield Challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1599963#M44342</link>
      <description>&lt;P&gt;I think the following will be helpful for you:&lt;/P&gt;&lt;P&gt;load *, rowno() as RowNo;&lt;BR /&gt;load *, if(Counter = 1, 'Sub-ID', CategoryT) as Category, if(Counter = 1, CategoryT, ValueT) as Value;&lt;BR /&gt;load *, subfield(Lines, ':', 1) as CategoryT, subfield(Lines, ':', 2) as ValueT, mod(IterNo, 4) as Counter;&lt;BR /&gt;load *, subfield([Detail Entries], chr(10), iterno()) as Lines, iterno() as IterNo&lt;BR /&gt;&amp;nbsp;&amp;nbsp; while iterno() &amp;lt;= substringcount([Detail Entries], chr(10)) + 1;&lt;BR /&gt;load [Purchase-Line], [Detail Entries], recno() as RecNo&lt;BR /&gt;from [Subfield-Challenge td-p 1599919.xlsx] (ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="subfield.JPG"&gt;&lt;img src="https://community.qlik.com/skins/images/F8B11FBB1963C3F5190A68D84129B237/responsive_peak/images/image_not_found.png" alt="subfield.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you really need to create multiple fields from Category and Value you could use a generic load, multiple loads with appropriate where-clauses to join them together or some further extendings/adjustments in the above matching with interrecord-functions to bring the various values into one record and deleting the unapproriate ones afterwards.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:19:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1599963#M44342</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-07-08T14:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield Challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1599985#M44345</link>
      <description>&lt;P&gt;A challenge it was, but this will work, I'll let you do the final touchup on splitting date and hours.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 631px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15081i52F99E817A969BE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;DataPrep:
LOAD 
  [Purchase-Line], 
  replace(trim(subfield([Detail Entries], '|')), chr(10), '|') as PartDetail;
LOAD 
  [Purchase-Line], 
  replace([Detail Entries], '2:'&amp;amp;chr(10),'|2:'&amp;amp;chr(10)) as [Detail Entries]
FROM
  [subfield challenge.xlsx]
  (ooxml, embedded labels, table is Document_TB08);

Data:
LOAD 
 AutoNumberHash128( [Purchase-Line], [Entry no]) as Key,
 [Purchase-Line],
 [Entry no],
 trim(MID( PartDetailDetail, 1, index(PartDetailDetail,':')-1)) as Header,
 trim(MID( PartDetailDetail,  index(PartDetailDetail,':')+1)) as Value
;
LOAD
 [Purchase-Line],
 left (PartDetail,1) as [Entry no],
 SubField(PartDetail, '|') as PartDetailDetail
Resident 
 DataPrep;
 ;
 
Gen:
GENERIC LOAD 
  [Purchase-Line],
  [Entry no], 
  Header , 
  Value
Resident 
  Data
WHERE 
  not isnum(Header) //Excluding the entry number 
;

SET vDimensions= 'Gen.Date/Hour','Gen.Terminal','Gen.User'; //Commaseparated list of generic tables.

Final:
Load distinct 
  [Purchase-Line], 
  [Entry no] 
RESIDENT 
  Data;

For each vTable in $(vDimensions)
  Left Join (Final) Load * Resident [$(vTable)];
  Drop Table [$(vTable)];
Next vTable

DROP TABLE Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:04:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1599985#M44345</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-07-08T15:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield Challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600007#M44350</link>
      <description>&lt;P&gt;Thanks Vegar! It works like a charm! Nice job&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:44:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600007#M44350</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2019-07-08T15:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield Challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600011#M44351</link>
      <description>&lt;P&gt;Thanks Marcus for the answer! It was very helpful.&lt;/P&gt;&lt;P&gt;Regards, Marcel.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:46:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600011#M44351</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2019-07-08T15:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield Challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600012#M44352</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mapSubstring:&lt;BR /&gt;mapping LOAD * inline [&lt;BR /&gt;x, y&lt;BR /&gt;1:, |||&lt;BR /&gt;2:, |||&lt;BR /&gt;Date/Hour:, Date/Hour&lt;BR /&gt;Terminal:, Terminal&lt;BR /&gt;Terminal :, Terminal&lt;BR /&gt;User:, User&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subfield_1:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load&lt;BR /&gt;"Purchase-Line",&lt;BR /&gt;MapSubstring ('mapSubstring', "Detail Entries") as "Detail Entries"&lt;BR /&gt;Resident&lt;BR /&gt;Document_TB08&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Drop Table Document_TB08;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Subfield_2:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load&lt;BR /&gt;"Purchase-Line",&lt;BR /&gt;Subfield("Detail Entries",'|||',2) as "Detail Entries 1",&lt;BR /&gt;Subfield("Detail Entries",'|||',3) as "Detail Entries 2"&lt;BR /&gt;Resident&lt;BR /&gt;Subfield_1&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Drop Table Subfield_1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Final:&lt;BR /&gt;// Entry 1&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load&lt;BR /&gt;"Purchase-Line",&lt;BR /&gt;1 as Entry,&lt;BR /&gt;Date(floor(num(Date#(Trim(Subfield(Trim(Subfield("Detail Entries 1",'&amp;lt;/&amp;gt;',3)),' ',1)),'DD/MM/YYYY'))),'DD/MM/YYYY') as Date,&lt;BR /&gt;Hour(num(Time#(Trim(Subfield(Trim(Subfield("Detail Entries 1",'',3)),' ',2)),'HH:MM'))) as Hour,&lt;BR /&gt;Trim(Subfield("Detail Entries 1",'&amp;lt;/&amp;gt;',5)) as Terminal,&lt;BR /&gt;Trim(Subfield("Detail Entries 1",'&amp;lt;/&amp;gt;',7)) as User&lt;BR /&gt;Resident&lt;BR /&gt;Subfield_2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Concatenate(Final)&lt;BR /&gt;// Entry 2&lt;BR /&gt;Load&lt;BR /&gt;"Purchase-Line",&lt;BR /&gt;2 as Entry,&lt;BR /&gt;Date(floor(num(Date#(Trim(Subfield(Trim(Subfield("Detail Entries 2",'&amp;lt;/&amp;gt;',3)),' ',1)),'DD/MM/YYYY'))),'DD/MM/YYYY') as Date,&lt;BR /&gt;Hour(num(Time#(Trim(Subfield(Trim(Subfield("Detail Entries 2",'',3)),' ',2)),'HH:MM'))) as Hour,&lt;BR /&gt;Trim(Subfield("Detail Entries 2",'&amp;lt;/&amp;gt;',5)) as Terminal,&lt;BR /&gt;Trim(Subfield("Detail Entries 2",'&amp;lt;/&amp;gt;',7)) as User&lt;BR /&gt;Resident&lt;BR /&gt;Subfield_2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop Table Subfield_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="2019-07-08 17_45_15-Qlik Sense Desktop.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15084iF5CD61EF91C84315/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2019-07-08 17_45_15-Qlik Sense Desktop.png" alt="2019-07-08 17_45_15-Qlik Sense Desktop.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:47:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600012#M44352</guid>
      <dc:creator>held_florian</dc:creator>
      <dc:date>2019-07-08T15:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield Challenge</title>
      <link>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600190#M44367</link>
      <description>&lt;P&gt;the right mapping table&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":see_no_evil_monkey:"&gt;🙈&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-07-09 06_55_09-Qlik Sense Desktop.png" style="width: 277px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15112i01D0254F05209710/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-07-09 06_55_09-Qlik Sense Desktop.png" alt="2019-07-09 06_55_09-Qlik Sense Desktop.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 05:00:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subfield-Challenge/m-p/1600190#M44367</guid>
      <dc:creator>held_florian</dc:creator>
      <dc:date>2019-07-09T05:00:31Z</dc:date>
    </item>
  </channel>
</rss>

