QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for
Did you mean:
Partner

Create array from field values

Good Day,

Has anyone created a field with an array of values?

Below is script that demonstrates what I'm trying to achieve.

The desired output is for [Inner Table] to have the following:

Inner CodeInner Value
1A, B, C
2D, E, F
3G, H, I

[Data_Table]:
Code, Value
1, A
1, B
1, C
2, D
2, E
2, F
3, G
3, H
3, I
];

For Each x in FieldValueList('Code')

Let vCurrentCode = \$(x);

[Outer Table]:
'\$(x)' as "Outer Code"
AutoGenerate 1;

For Each y in FieldValueList('Code')

Let ConcatenatedValue = ConcatenatedValue & ' ' & Peek('Value',y,'Data_Table') & ',';

[Inner Table]:
'\$(x)' as "Inner Code",
'\$(ConcatenatedValue)' AS "Inner Value"
AutoGenerate 1
Where
\$(x) = \$(vCurrentCode);

Let content = Null;

Next y

Next x

1 Solution

Accepted Solutions

Hi,

try below script

[Data_Table]:

Code, Value

1, A

1, B

1, C

2, D

2, E

2, F

3, G

3, H

3, I

];

Noconcatenate

Final:

Concat(Value,' ,') as InnerValue

Resident [Data_Value]

Group By Code;

Drop table [Data_Value];

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
4 Replies

May be try this..

[Data_Table]:

Code, Value

1, A

1, B

1, C

2, D

2, E

2, F

3, G

3, H

3, I

];

NoConcatenate

New:

LOAD Code,Concat(Value,',') as Inner_Value Resident [Data_Table] Group by Code;

DROP Table [Data_Table];

Hi,

try below script

[Data_Table]:

Code, Value

1, A

1, B

1, C

2, D

2, E

2, F

3, G

3, H

3, I

];

Noconcatenate

Final:

Concat(Value,' ,') as InnerValue

Resident [Data_Value]

Group By Code;

Drop table [Data_Value];

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Partner
Author

Thanks Max,

That solved it.

Champion