Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

peterwh
Contributor

Howto load text file with fixed and variable part

Hello,

I'm getting the same error message as in "Too complex, more than 100 levels nesting", but my problem is, I don't have any idea how to make a better solution. So does anyone have a - maybe simplier - solution for the following problem:

I have to read a txt-file (separated by ";") with a fixed part and a variable part. The number of columns is defined by a value in the fixed part. I have to get a table where for every value is in a separated line with a changed Timestamp.

At the moment I make it with variables and nested-ifs where IterNo() is the condition and the timestamp-calculation is based on IterNo() too.

Example txt-File:

Counter; Timestamp      ; NoOfValues; V1; V1Flag; V2; V2Flag;...... Vn; VnFlag;

4711   ; 01.01.12 01:00 ; 24        ; 10; W     ; 20; W     ;......

4712   ; 01.01.12 00:15 ; 96        ; 15; W     ; 10; F     ;........

Result:

Counter; Timestamp      ; Value; ValueFlag;

4711   ; 01.01.12 01:00 ; 10   ; W        ;

4711   ; 01.01.12 02:00 ; 20   ; W        ;

...

4711   ; 02.01.12 00:00 ; 30   ; W        ;

4712   ; 01.01.12 00:15 ; 15   ; W        ;

4712   ; 01.01.12 00:30 ; 10   ; F        ;

...

4712   ; 02.01.12 00:00 ; 20   ; W        ;

Thanks in advance for any help.

Peter


2 Replies
jason_michaelid
Honored Contributor II

Howto load text file with fixed and variable part

Look up CrossTable() in the reference manual. If you need further help let us know.

Jason

vlad_komarov
Valued Contributor III

Howto load text file with fixed and variable part

You can use default QV CrossTable functionality or use third party products, this one for example:

http://www.dbsoftlab.com/etl-tools/qlikview-connector/overview.html

Community Browser