<?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: How to extract specific data from the field and aligned the field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-extract-specific-data-from-the-field-and-aligned-the/m-p/1642150#M731156</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD If(not Match(Category, 'Animal', 'Bird', 'Fish'), Peek('Category'), Category) as Category,
	 If(not Match(Category, 'Animal', 'Bird', 'Fish'), Category) as Type;
LOAD * INLINE [
    Category 
    Animal
    Tiger
    Polar Bear
    Bird
    Parrot
    Owl
    Humming bird
    Fish
    Dolphin
    Blue Whale
];

MappingTable1:
Mapping
LOAD Type,
	 Type &amp;amp; ','
Resident Table
Where Len(Trim(Type)) &amp;gt; 0;

MappingTable2:
Mapping
LOAD Type,
	 Category
Resident Table
Where Len(Trim(Type)) &amp;gt; 0;

DROP Table Table;

Fact:
LOAD ID,
	 ApplyMap('MappingTable2', Type, 'N/A') as Category,
	 Type
Where Len(Trim(Type)) &amp;gt; 0;
LOAD *,
	 SubField(MapSubString('MappingTable1', Field1), ',') as Type;
LOAD * INLINE [
    ID, Field1
    1, DolphinTigerHumming bird
    2, ParrotPolar BearBlue Whale
    3, Polar BearParrotDolphin
    4, DolphinOwlTiger
    5, OwlBlue WhaleTiger
    6, Humming birdPolar BearBlue Whale
    7, DolphinParrotPolar Bear
    8, TigerParrotBlue Whale
    9, Humming birdTigerDolphin
    10, Polar BearOwlDolphin
];

FinalFact:
LOAD DISTINCT ID
Resident Fact;

FOR i = 1 to FieldValueCount('Category')

	LET vCategory = FieldValue('Category', $(i));
	
	Left Join (FinalFact)
	LOAD DISTINCT ID,
		 Type as [$(vCategory)]
	Resident Fact
	Where Category = '$(vCategory)';
	
NEXT

DROP Table Fact;&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 01 Nov 2019 16:31:41 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-11-01T16:31:41Z</dc:date>
    <item>
      <title>How to extract specific data from the field and aligned the field</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-extract-specific-data-from-the-field-and-aligned-the/m-p/1642119#M731155</link>
      <description>&lt;P&gt;Extract the specific text from the field and aligned it in the correct field.&lt;/P&gt;&lt;P&gt;Classified the fields based on the defined field. Please refer the screenshot below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Category.JPG" style="width: 799px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/22763iCF7AD9026B76AAEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Category.JPG" alt="Category.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;ID, Field1&lt;BR /&gt;1, DolphinTigerHumming bird&lt;BR /&gt;2, ParrotPolar BearBlue Whale&lt;BR /&gt;3, Polar BearParrotDolphin&lt;BR /&gt;4, DolphinOwlTiger&lt;BR /&gt;5, OwlBlue WhaleTiger&lt;BR /&gt;6, Humming birdPolar BearBlue Whale&lt;BR /&gt;7, DolphinParrotPolar Bear&lt;BR /&gt;8, TigerParrotBlue Whale&lt;BR /&gt;9, Humming birdTigerDolphin&lt;BR /&gt;10, Polar BearOwlDolphin&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-extract-specific-data-from-the-field-and-aligned-the/m-p/1642119#M731155</guid>
      <dc:creator>karan_kn</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract specific data from the field and aligned the field</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-extract-specific-data-from-the-field-and-aligned-the/m-p/1642150#M731156</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD If(not Match(Category, 'Animal', 'Bird', 'Fish'), Peek('Category'), Category) as Category,
	 If(not Match(Category, 'Animal', 'Bird', 'Fish'), Category) as Type;
LOAD * INLINE [
    Category 
    Animal
    Tiger
    Polar Bear
    Bird
    Parrot
    Owl
    Humming bird
    Fish
    Dolphin
    Blue Whale
];

MappingTable1:
Mapping
LOAD Type,
	 Type &amp;amp; ','
Resident Table
Where Len(Trim(Type)) &amp;gt; 0;

MappingTable2:
Mapping
LOAD Type,
	 Category
Resident Table
Where Len(Trim(Type)) &amp;gt; 0;

DROP Table Table;

Fact:
LOAD ID,
	 ApplyMap('MappingTable2', Type, 'N/A') as Category,
	 Type
Where Len(Trim(Type)) &amp;gt; 0;
LOAD *,
	 SubField(MapSubString('MappingTable1', Field1), ',') as Type;
LOAD * INLINE [
    ID, Field1
    1, DolphinTigerHumming bird
    2, ParrotPolar BearBlue Whale
    3, Polar BearParrotDolphin
    4, DolphinOwlTiger
    5, OwlBlue WhaleTiger
    6, Humming birdPolar BearBlue Whale
    7, DolphinParrotPolar Bear
    8, TigerParrotBlue Whale
    9, Humming birdTigerDolphin
    10, Polar BearOwlDolphin
];

FinalFact:
LOAD DISTINCT ID
Resident Fact;

FOR i = 1 to FieldValueCount('Category')

	LET vCategory = FieldValue('Category', $(i));
	
	Left Join (FinalFact)
	LOAD DISTINCT ID,
		 Type as [$(vCategory)]
	Resident Fact
	Where Category = '$(vCategory)';
	
NEXT

DROP Table Fact;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Nov 2019 16:31:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-extract-specific-data-from-the-field-and-aligned-the/m-p/1642150#M731156</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-11-01T16:31:41Z</dc:date>
    </item>
  </channel>
</rss>

