<?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: Large text need to split into seperate fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1633624#M446647</link>
    <description>&lt;P&gt;Craig, did Anand's post help you with things?&amp;nbsp; If so, be sure to give him credit by using the Accept as Solution button on his post.&amp;nbsp; If you have gone a different route, consider sharing that and then mark it with the button so others will know how you solved things, and if you are still trying to sort things out, leave us an update, so we can try to come up with some other ideas.&amp;nbsp; I am pretty sure Anand's approach is likely the best way to go, but I am not exactly an expert on development, so others may have some further ideas.&amp;nbsp; My post will kick things back up today, so we will see if anyone else has anything for you.&amp;nbsp; About the best I have otherwise would be the Design Blog area, below is the base URL where you can search just in that area, you might be able to get some ideas from posts there...&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Sorry I do not have anything better for you.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2019 12:18:35 GMT</pubDate>
    <dc:creator>Brett_Bleess</dc:creator>
    <dc:date>2019-10-10T12:18:35Z</dc:date>
    <item>
      <title>Large text need to split into seperate fields</title>
      <link>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1630923#M446448</link>
      <description>&lt;P&gt;I have a large text which is deposited in DB which is the answers to multiple questions from custom fields added to a form. The data is stored as a single blob of text.&lt;/P&gt;&lt;P&gt;I want to split this out to different fields&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question name would be Field name eg SMI Number value would be 0212 can any advise on method to do this ?&lt;/P&gt;&lt;P&gt;See sample below&lt;/P&gt;&lt;P&gt;&amp;lt;questionnaire questionnaire_id="PROJECT - SMI"&amp;gt;&amp;lt;question quest_name="SMI Number" value="0212"/&amp;gt;&amp;lt;question quest_name="Requester" value="ALAN ROPER 150605"/&amp;gt;&amp;lt;question quest_name="Agreement Number" value="4610001895"/&amp;gt;&amp;lt;question quest_name="Contract" value="%27Facilities-Management"/&amp;gt;&amp;lt;question quest_name="Contractor" value="%27Mite"/&amp;gt;&amp;lt;question quest_name="Contract condition" value="%2716.2"/&amp;gt;&amp;lt;question quest_name="End Client" value="%27Sellafield"/&amp;gt;&amp;lt;question quest_name="Building Manager" value="JESSICA SMITH 192436"/&amp;gt;&amp;lt;question quest_name="Out of hours work" value="No"/&amp;gt;&amp;lt;question quest_name="Design Request only" value="No"/&amp;gt;&amp;lt;question quest_name="SMI Priority" value="HIGH"/&amp;gt;&amp;lt;question quest_name="CEMAR Reference" value="PICD 5145"/&amp;gt;&amp;lt;question quest_name="Contractor Finance Code" value="MFM-03011-00001-03-539"/&amp;gt;&amp;lt;question quest_name="Quoted Value" value="9669.69"/&amp;gt;&amp;lt;question quest_name="Final invoice Value" value="9669.69"/&amp;gt;&amp;lt;/questionnaire&amp;gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:19:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1630923#M446448</guid>
      <dc:creator>cmorton1964</dc:creator>
      <dc:date>2024-11-16T02:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Large text need to split into seperate fields</title>
      <link>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1630928#M446451</link>
      <description>&lt;P&gt;you need to write a parser,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first parse text into different rows with subfield function (maybe on '&amp;gt;'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then to assign these values to different fields&lt;/P&gt;&lt;P&gt;you can use mid with index on substring and value&lt;/P&gt;&lt;P&gt;you can try to explore regular expression&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RegExTest function,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 09:35:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1630928#M446451</guid>
      <dc:creator>asinha1991</dc:creator>
      <dc:date>2019-10-03T09:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Large text need to split into seperate fields</title>
      <link>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1633624#M446647</link>
      <description>&lt;P&gt;Craig, did Anand's post help you with things?&amp;nbsp; If so, be sure to give him credit by using the Accept as Solution button on his post.&amp;nbsp; If you have gone a different route, consider sharing that and then mark it with the button so others will know how you solved things, and if you are still trying to sort things out, leave us an update, so we can try to come up with some other ideas.&amp;nbsp; I am pretty sure Anand's approach is likely the best way to go, but I am not exactly an expert on development, so others may have some further ideas.&amp;nbsp; My post will kick things back up today, so we will see if anyone else has anything for you.&amp;nbsp; About the best I have otherwise would be the Design Blog area, below is the base URL where you can search just in that area, you might be able to get some ideas from posts there...&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Sorry I do not have anything better for you.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 12:18:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1633624#M446647</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-10-10T12:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Large text need to split into seperate fields</title>
      <link>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1634062#M446671</link>
      <description>&lt;P&gt;I think I wouldn't create multiple fields within a crosstable else I would create a stream-table, with something like this:&lt;/P&gt;&lt;P&gt;t1: load&lt;BR /&gt;&amp;nbsp;&amp;nbsp; KEY, mod(rowno(), 2) as Filter,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; subfield(subfield(YourField, '&amp;gt;'), '=', 1) as Attribut, subfield(subfield(YourField, '&amp;gt;'), '=', 2) as Value&lt;BR /&gt;from Source;&lt;/P&gt;&lt;P&gt;t2: noconcatenate load * resident where Filter = 1;&lt;/P&gt;&lt;P&gt;drop tables t1;&lt;/P&gt;&lt;P&gt;Further you may apply various string-functions like replace/purgechar/trim/mid and so on to remove chars like &amp;lt;&amp;gt;/%.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 06:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1634062#M446671</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-10-11T06:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Large text need to split into seperate fields</title>
      <link>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1634288#M446685</link>
      <description>&lt;P&gt;Your field has a xml content, so you can use the xml-parser to split it in separate fields.&lt;BR /&gt;The only thing you have to do, is to expand the xml content with the primary key of the table.&lt;/P&gt;&lt;P&gt;For Example:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;DB_TABLE:
Load 
RecNo() as primary_key,
* 
INLINE [
    Field1,Field2,Field3,
    123,aaa,'&amp;lt;questionnaire questionnaire_id="PROJECT - SMI"&amp;gt;...'
    456,bbb,'&amp;lt;questionnaire questionnaire_id="PROJECT - ABC"&amp;gt;...'
    789,bbb,'&amp;lt;questionnaire questionnaire_id="PROJECT - DEF"&amp;gt;...'
];

XML:
load
'&amp;lt;data&amp;gt;' &amp;amp; Concat(xmlField) &amp;amp; '&amp;lt;/data&amp;gt;' as xmlField;
Load
'&amp;lt;record primary_key="' &amp;amp; primary_key &amp;amp; '"&amp;gt;' &amp;amp; Field3 &amp;amp; '&amp;lt;/record&amp;gt;' as xmlField
resident DB_TABLE;

question:
LOAD quest_name,
    value,
    %Key_record_EF79C51078A65475 as xml_key
From_Field(XML,xmlField) (XmlSimple, Table is [data/record/questionnaire/question]);

record:
LOAD primary_key,
    [questionnaire/questionnaire_id] as QUEST.questionnaire_id,
    %Key_record_EF79C51078A65475 as xml_key
From_Field(XML,xmlField) (XmlSimple, Table is [data/record]);

DROP Table XML;

left join(DB_TABLE)
load * resident record;

for i = 1 to fieldvaluecount('quest_name');
	let field = fieldvalue('quest_name',$(i));	

	left join(DB_TABLE)
	load
	xml_key,
	value as "QUEST.$(field)"
	resident question
	where quest_name='$(field)';
next

drop tables record,question;
drop field xml_key;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 13:30:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Large-text-need-to-split-into-seperate-fields/m-p/1634288#M446685</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2019-10-11T13:30:03Z</dc:date>
    </item>
  </channel>
</rss>

