Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Making this .txt readable for Qlikview

Hey guys, I have this .txt file that is a bit different the extraction for qlikview to read it as a database. In order to become a database, I managed this by using the fill out in the transformation step, but i wonder if there is a better way of doing it, easier one...

Please, check it out the .txt file, try to load it in the qlikview, and tell me if there is a better way than using the fill out step.

Thank you,

1 Solution

Accepted Solutions

Re: Making this .txt readable for Qlikview

Depending on what you want to wind up with, one approach may be:

Raw:

LOAD @1,

    @2,

    @3,

    @4

FROM

[My restaurant.txt]

(txt, codepage is 1252, no labels, delimiter is '\t', msq, header is 0 lines, filters(

Replace(1, top, StrCnd(null))

));

Menu:

LOAD

  if(@2='',peek('Course', RowNo()-2), @2) as Course,

  if(@3='',peek('Dish', RowNo()-2), @3) as Dish,

  @4 as Ingredient

RESIDENT Raw

WHERE @1 = 'Menu'

;

And then do the same for Foods and Ingredients as I did for menu.

-Rob

3 Replies
amit_saini
Honored Contributor III

Re: Making this .txt readable for Qlikview

Hi Julio,

Please see the attachment.

Thanks,

AS

vikasmahajan
Honored Contributor III

Re: Making this .txt readable for Qlikview

You can use Generic Load pfa sample.

vikas

Re: Making this .txt readable for Qlikview

Depending on what you want to wind up with, one approach may be:

Raw:

LOAD @1,

    @2,

    @3,

    @4

FROM

[My restaurant.txt]

(txt, codepage is 1252, no labels, delimiter is '\t', msq, header is 0 lines, filters(

Replace(1, top, StrCnd(null))

));

Menu:

LOAD

  if(@2='',peek('Course', RowNo()-2), @2) as Course,

  if(@3='',peek('Dish', RowNo()-2), @3) as Dish,

  @4 as Ingredient

RESIDENT Raw

WHERE @1 = 'Menu'

;

And then do the same for Foods and Ingredients as I did for menu.

-Rob

Community Browser