Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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!!!

3 Replies
Not applicable
Author

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
Author

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

johnw
Champion III
Champion III

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;