Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Miguel_Angel_Baeyens

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
Author

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.