Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SUBFIELD Function Problems

Hello,

The below script runs all right when the application is reloaded with de CTRL+R on the developer IDE, but when scheduled on a trigger and reloaded automatically by the server the column 'equipe_responsavel' returns all values with null instead of the right result, anyone can help me? I've tried to reload only this table, and the result is always the same

[TESTE]:

  LOAD

  nmequiperesponsavel,

SUBFIELD(nmequiperesponsavel,',') AS 'equipe_responsavel';

  SELECT DISTINCT

    nmequiperesponsavel

FROM vw_sel_tickets_cw;

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes, it probably is a bug. There was that exact bug on V9 SR7 -- two parm subfield returns nulls. I suspect you are using SR7 on the server and a different build on the desktop.

-Rob

http://masterssummit.com

View solution in original post

23 Replies
Not applicable
Author

try whit this:

[TESTE]:

NOCONCATENATE LOAD

  nmequiperesponsavel,

SUBFIELD(nmequiperesponsavel,',')  AS  equipe_responsavel;

SQL SELECT DISTINCT

    nmequiperesponsavel

FROM vw_sel_tickets_cw;



Hope this helps

MC

sivarajs
Specialist II
Specialist II

Remove the quotes for field name

[TESTE]:

  LOAD

  nmequiperesponsavel,

SUBFIELD(nmequiperesponsavel,',') AS equipe_responsavel;

  SELECT DISTINCT

    nmequiperesponsavel

FROM vw_sel_tickets_cw;

Not applicable
Author

Doesn't work...

Not applicable
Author

Doesn't work...

sivarajs
Specialist II
Specialist II

will nmequiperesponsavel field gets value when reloading from trigger

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

What is the value you expect? This script will return one line for each subfield token (comma separated) from each source row. It will return nulls for empty tokens (two consecutive commas).

If that's not what you require, then you need to be more specific about what you are getting and what you require, preferably by posting some sample data and a qvw model (reduce in size if its large and scramble confidential fields).

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jfkinspari
Partner - Specialist
Partner - Specialist

Try and debug by taking the script part by part

does SELECT DISTINCT filename FROM ... Work, when executed by Publisher?

Not applicable
Author

yes!

christian77
Partner - Specialist
Partner - Specialist

I tjink you need to specify what part of your field you want.

subfield(Field,'separator',1) that menas 1st part subfield(Field, 'separator', 2) 2nd part.

What happens if some values don't bring separator cause they are just one part?

Lionel - Messi

Cristiano - Ronaldo

Pele

In the 3rd case, it wont give you anything.

Then use subfield(Field & '-', '-', 1)    ------> Concat yourself the separator.

Also, place an example of your records to see how they are coming.

Salutes