Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to execute subfield() function in qlikview?

hi guys,

I create a table box with  sub field function. In script page I use a sub field () function after I reload this script but It did not execute perfectly,it shows error, i do not know how to overcome this problem. please tell me out  how to solve this problem. I attached snipping file below this box.

Regards:

madhu

22 Replies
its_anandrjs

Remove single cots from the subfield like

in place of this

SUBFIELD('SKILLS',',')AS SKILLS


Write like


SUBFIELD(SKILLS,',')AS SKILLS



Or suggest you check the position of the ',' in the SKILLS field

Not applicable
Author

Hi Madhu,

Your approach toward the problem is right but you just need some correction in your code.

They are as follows:

the field name emp in the resident load does not exist in the main table.So either change in any one of the table and make both name same.

and one morething make sure your skills column contains the data like ','.So that you will be able able to view the result.

Just make all the required changes.

Hope it will work.Thanks

Regards,

Biren Agrawalla

Not applicable
Author

thanks Srivastava it works but It gives results add old data  like this.1.table is excel data 2.is using subfield()function table. I want to results like 3 table, table name { Individual skills table.}

1.old data table:                                                                  

employeeno  Skills
159Economics,pharmacology
163Marketing,sociology,spanish
174Bookkeeping,particle,Physics
210Economics,Marketing
215Economics,Law,Marketing
279Law,Marketing,German
286Finance,Marketing,French,German
300Bookkeeping,Finance

2.after subfield()function applied display table like this:

employeenoSkills
159Economics
159Economics,pharmacology
159pharmacology
163Marketing
163Marketing,sociology,spanish
163sociology
163spanish
174Bookkeeping
174Bookkeeping,particle,Physics
174particle
174Physics
210Economics
210Economics,Marketing
210Marketing
215Economics
215Economics,Law,Marketing
215Law
215Marketing
279German
279Law
279Law,Marketing,German
279Marketing
286Finance
286Finance,Marketing,French,German
286French
286German
286Marketing
300Bookkeeping
300Bookkeeping,Finance
300Finance

3.perfect table.

Not applicable
Author

thanks Agrawalla

swuehl
MVP
MVP

I think your second load will just concatenate to your original table.

Use a NONCONCATENATE LOAD prefix to your second table, then drop the first table at the end of your second load.

Not applicable
Author

I Wrote drop table employ skills after i reload script. it displayed empty table .when remove the drop table It reloads then it gives wrong results.

swuehl
MVP
MVP

emloyskills:

Load employeeno,

Skills

   
FROM
[...\Data\Employskills.xlsx]
(
ooxml, embedded labels, table is Sheet1);

indskills:

NOCONCATENATE Load
employeeno, SubField(Skills,',') as Skills

Resident emloyskills;

Drop Table emloyskills;

nizamsha
Specialist II
Specialist II

EmployeeSkills:

Load

EmployeeNo ,

Skills 

from your Table;

MindSkills:

noconcatenate

load

EmployeeNo  as emp,

Subfield(Skills,',',-1) as Skills

resident EmployeeSkills;

Not applicable
Author

thanks tressco.

Not applicable
Author

i use noconcatenate but it gives same results.