Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

21 Replies
MVP
MVP

Re: how to execute subfield() function in qlikview?

Change 'skills'  to 'Skills'.      // S - in capital.

MVP
MVP

Re: how to execute subfield() function in qlikview?

First, table names are case sensitive, so your resident load should be

...

Resident employskills;

Then:

Field names are also case sensitive and emp does not exist in table employskills.

sushil353
Honored Contributor II

Re: how to execute subfield() function in qlikview?

Hi,

What is the error you are getting?

Skills not skills

also check your first field name it is employeeno and you have taken emp..

HTH

Sushil

Re: how to execute subfield() function in qlikview?

You are loading a field "emp" that is not available in your source table. And QlikView is case sensitive, meaning that you have to spell all fieldnames exactly like they were defined. Field "Skills" is available, but "skills" isn't.

Best,

Peter

Re: how to execute subfield() function in qlikview?

Write like

Subfield(Skills,',',1 )   put location of the ',' or share the sample.

Or

Subfield(Skills,',')

Not applicable

Re: how to execute subfield() function in qlikview?

in the below table script, Field name and table name must be same as above .

Use employeeno instead of emp,

Skills instead of skills,

and emloyskills instead of Employskills.

emloyskills:

Load employeeno,

Skills

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

indskills:

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

Resident emloyskills;

Drop Table emloyskills;

Re: how to execute subfield() function in qlikview?

You have to write like

employskills:

Load employeeno as emp,

Skills

From Location;

indskills:

Load

emp,Subfield(Skills,',') as skills

Resident employskiils;

Drop table employskills

Not applicable

Re: how to execute subfield() function in qlikview?

hi chouhan see my script.

EMPLOYSKILLS:

LOAD EMPLOYEENO,

     SKILLS

FROM

[..\DATA\EMPLOYSKILLS.XLSX]

(OOXML, EMBEDDED LABELS, TABLE IS SHEET1);

INDSKILLS:

LOAD

[EMPLOYEENO],SUBFIELD('SKILLS',',')AS SKILLS

RESIDENT EMPLOYSKILLS;

chauhans85
Esteemed Contributor

Re: how to execute subfield() function in qlikview?

Please give space between )as  and write 'Skill'  without single quote  in your script

i mean to say subfiled(Skills,',') as skills

see the example below if data is like below

abc,123,cde

here subfield('abc,123,cde,',',1)  will result in abc

subfield('abc,123,cde',',',2) will Result in 123

subfield('abc,123,cde',',',3) will result in cde

hope this helps

Community Browser