Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Dynamic Field Names

Hi...

I'm trying to load multiple Fields into one Flied:

For example:

LOAD

Icd+iterno() AS Icd

FROM .... WHILE iterno()<=30;


In this File are 30 Fields from "Icd1" to Icd30.

Is there any clue to solve that problem without using 30 JOIN LOAD of that Table?

Thanks!!!

Tags (3)
3 Replies
Not applicable

Dynamic Field Names

Hi,

If I understand the problem correctly, you want to take data for all 30 columns from source file and store into 1 column in qlikview. Below is a sample code for implementing this:



Tab1:
LOAD Icd1 AS Icd
FROM ....;

FOR a = 2 TO 30
CONCATENATE(Tab1)
LOAD Icd$(a) AS Icd
FROM ...;
NEXT



Hope this works..

Thanks

Amit

Not applicable

Dynamic Field Names

Hello Olaf,

Not sure if I understand the question; could you explain what your input format is (I guess it's rows with columns ICD1 - ICD30) and what output format you want (rows with [ICD1, <value>], [ICD2, <value>], etc.? or perhaps all ICD-values concatenated as '<value>, <value>, <value>, ...' in one column?)

With regards,

Martijn ter Schegget

MVP
MVP

Dynamic Field Names

OK, so you have a table like this?

Icd1 Icd2 Icd3... Icd30
5 10 20 ... 50
3 2 1 ... 14

And you want to end up with a table like this?

Icd
5
10
20
...
50
3
2
1
...
14

If so, then I believe this would work:

CROSSTABLE (Sequence,Icd,0)
LOAD Icd1, Icd2, Icd3... Icd30
FROM your data source;
DROP FIELD Sequence;

Community Browser