Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
WE ARE LISTENING! New Navigation for Qlik Community, Sept. 26: TELL ME MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mwscott1
Creator
Creator

Subfield to separate columns mapping values

In the load statement how do I make this column 

What has contributed most to your production or success to date?
Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) ;Technology (i.e. Agent Assist, virtual enrollment tools, etc.)
Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) 
Training (Foundations Class, Opener GPS, etc.) ;Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) ;Understanding of compensation;Ability to gain new accounts
Training (Foundations Class, Opener GPS, etc.) ;Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) 
Training (Foundations Class, Opener GPS, etc.) 
Training (Foundations Class, Opener GPS, etc.) ;Understanding of compensation

 

Look like this

Option1Option2Option3Option4Option5
 Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) Technology (i.e. Agent Assist, virtual enrollment tools, etc.)  
 Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.)    
Training (Foundations Class, Opener GPS, etc.) Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.)  Understanding of compensationAbility to gain new accounts
Training (Foundations Class, Opener GPS, etc.) Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.)    
Training (Foundations Class, Opener GPS, etc.)     
Training (Foundations Class, Opener GPS, etc.)   Understanding of compensation 
1 Reply
sunny_talwar

Try something like this

OptionMapping:
Mapping
LOAD F1,
	 '@' & F2 & '@';
LOAD * INLINE [
    F1, F2
    Training, Option 1
    Support, Option 2
    Technology, Option 3
    Understanding, Option 4
    Ability, Option 5
];

Table:
LOAD [What has contributed most to your production or success to date?],
	 Value,
	 TextBetween(MapSubString('OptionMapping', Value), '@', '@') as Option;
LOAD [What has contributed most to your production or success to date?],
	 Trim(SubField([What has contributed most to your production or success to date?], ';')) as Value;	 
LOAD * INLINE [
    What has contributed most to your production or success to date?
    "Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) ;Technology (i.e. Agent Assist, virtual enrollment tools, etc.)"
    "Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) "
    "Training (Foundations Class, Opener GPS, etc.) ;Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) ;Understanding of compensation;Ability to gain new accounts"
    "Training (Foundations Class, Opener GPS, etc.) ;Support from sales team (Coaching sessions, joint field work, ongoing communication, etc.) "
    "Training (Foundations Class, Opener GPS, etc.) "
    "Training (Foundations Class, Opener GPS, etc.) ;Understanding of compensation"
];

FinalTable:
LOAD Distinct [What has contributed most to your production or success to date?]
Resident Table;

FOR i = 1 to FieldValueCount('Option')

	LET vOption = FieldValue('Option', $(i));
	
	Left Join (FinalTable)
	LOAD [What has contributed most to your production or success to date?],
		 Value as [$(vOption)]
	Resident Table
	Where Option = '$(vOption)';
	
NEXT

DROP Table Table;