Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Delimiter or something ?

Hi, All

             I have a problem about data. Now I reload data from database and create Table

The data in the Table show this >>

64:352;16:152

32:352;8:152

352:513;1024:2048     something like this.

And now need your help for I want to seperate from above to

64 as 1,

252 as 2,

16 as 3,

152 as 4   something like this.

please let's me know how about this solution ? or script

1 Reply
Miguel_Angel_Baeyens

Hi,

First, in your load, unify the delimiters to be say ":", then use the SubField() function to get each value:

Table:

LOAD SubField(Replace(Field, ';', ':'), ':') AS SubFields

FROM File.qvd (qvd);

There will be as much SubFields as values in the string separated by ":".

If the number of values is always fixed (say 4 according to your example) then change the load to

Table:

LOAD SubField(Replace(Field, ';', ':'), ':', 1) AS Part1,

     SubField(Replace(Field, ';', ':'), ':', 2) AS Part2,

     SubField(Replace(Field, ';', ':'), ':', 3) AS Part3,

     SubField(Replace(Field, ';', ':'), ':', 4) AS Part4

FROM File.qvd (qvd);

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica