Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Import data from Textfile

Hello I'm working now for one week with Qlikview and need your help. I have a Textfile with this structure:

20110930               (Datestring)

     Datastring1        (Datastrngs)

     Datastring2

     Datastring3

20110929                 (next Datestring)

     Datastring4          (Datastrngs)

     Datastring5

...

Now I want to import the Data like this:

Datestring          |          Datastring

-----------------------------------------------

20110930          |          Datastring1

20110930          |          Datastring2

20110930          |          Datastring3

20110929          |          Datastring4

20110929          |          Datastring5

I tryed many things but failed.

Thaks for your ideas.

2 Replies

Re: Import data from Textfile

Hi,

You can use the Previous() function to populate current record value with previous value

LOAD *,

     If(Len(Datastring) = 0, Previous(Datastring), Datastring)) AS Datastring

FROM File.txt;

If the field is empty, take the value from previous record, if it's not empty, take the current value.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable

Re: Import data from Textfile

Hi,

I have only one field. Now I have uploaded the file as attachement to understand the problem better.

Each line is a call and I want from every call the number which are the xxxxxxxxx and the date from the top. To get the phonenumber is no problem for me but i can't add the date to each call.

Thanks for your fast answer of the first post.