Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to work with array fields?

Guys, good morning!

I have a problem working with DATASUL, and a table of movement payroll I have 3 array where fields are delimited by ';' are the event codes, quantity and value of the event event. How can I separate this array making each event code is a record and comes with its value and quantity? The field is represented as the example below:

cdn_evento_fp -> 001, 031, 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...

qtd_event_fp -> 180, 40, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...

val_event_fp -> 1000.00, 200.00, 1200, 00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Hello Hugo,

you can use a combination of subfield and LOAD While:

RawData:

LOAD * INLINE [

    cdn_evento_fp, qtd_event_fp, val_event_fp

    "001, 031, 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "180, 40, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "1000.00, 200.00, 1200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"

];

ResultData:

NOCONCATENATE LOAD

    subfield(cdn_evento_fp, ',', IterNo()) as cdn_evento_fp,

    subfield(qtd_event_fp, ',', IterNo()) as qtd_event_fp,

    subfield(val_event_fp, ',', IterNo()) as val_event_fp   

Resident RawData

While subfield(cdn_evento_fp, ',', IterNo())>0;

Drop Table RawData;

- Ralf

Astrato.io Head of R&D

View solution in original post

8 Replies
MK_QSL
MVP
MVP

use subfield funtion.

Not applicable
Author

I used, but it did not work is returning the wrong values ​​and quantities

MK_QSL
MVP
MVP

if possible upload your file...

Not applicable
Author

Manish, thank you for help me... but I got it! I used wrong sintax, You you were right!

rbecher
MVP
MVP

Hello Hugo,

you can use a combination of subfield and LOAD While:

RawData:

LOAD * INLINE [

    cdn_evento_fp, qtd_event_fp, val_event_fp

    "001, 031, 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "180, 40, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "1000.00, 200.00, 1200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"

];

ResultData:

NOCONCATENATE LOAD

    subfield(cdn_evento_fp, ',', IterNo()) as cdn_evento_fp,

    subfield(qtd_event_fp, ',', IterNo()) as qtd_event_fp,

    subfield(val_event_fp, ',', IterNo()) as val_event_fp   

Resident RawData

While subfield(cdn_evento_fp, ',', IterNo())>0;

Drop Table RawData;

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Thank you!

So it was easier than what I did.

Not applicable
Author

Hugo!,

how did you connect with datasul? with ODBC? did you buy any license?

does the database has a password?

Not applicable
Author

I use ODBC connection with User name and password to the database, which is usually sysprogress. And no need to buy to use the ODBC license.