Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to normalize a List to single String(see Example)

Example:
I have a schema with id(String) and letters(List), and want to normalize this into key/letter.
From:
Row number id(String) letters(List)
1 k1
2 k2
to:

Row number id(String) letters(List)
1 k1 a
2 k1 b
3 k1 d
4 k2 b
5 k2 d
6 k2 g
Any component that do this ?
Audun
Labels (2)
6 Replies
Anonymous
Not applicable
Author

Hi,
You can use tNormalize component for this job.
--
Regards,
Vinod
Anonymous
Not applicable
Author

Hi,
You can use tNormalize component for this job.
--
Regards,
Vinod

Can´t, tNormalize works on String not List.
regards
Audun
Anonymous
Not applicable
Author

Before applying tNormalize on the field you can convert the data type using tConvertType or by using toString() in tJavaRow .
Anonymous
Not applicable
Author

Hi,
You can use below mentioned graph and code as sample.
Job Map
-----------
tFileInputDelimited --> tJavaRow --> tNormalize --> tLogRow
tFileInputDelimited Input
-------------------------
id;letters
k1;a,b,c
k2;d,e,f
tJavaRow code
--------------------
output_row.id = input_row.id;
output_row.letters = input_row.letters.toString().replace("", "");
Hope that helps.
--
Regards,
Vinod
Anonymous
Not applicable
Author

Hi,
You can use below mentioned graph and code as sample.
Job Map
-----------
tFileInputDelimited --> tJavaRow --> tNormalize --> tLogRow
tFileInputDelimited Input
-------------------------
id;letters
k1;a,b,c
k2;d,e,f
tJavaRow code
--------------------
output_row.id = input_row.id;
output_row.letters = input_row.letters.toString().replace("", "");
Hope that helps.
--
Regards,
Vinod

Why convert a List to String before creating a Array ? It will create bigger memory footprint. tNormalize should support List normalize.
janhess
Creator II
Creator II

Why not define letters as a string in your schema.