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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Concat XML loop attributes (byte array) to a string?

I have a byte array in XML that looks like this:

            <tsusip>
                <id>2</id>
                <id>123</id>
                <id>39</id>
                <id>-98</id>
                <id>0</id>
                <id>0</id>
                <id>3</id>
                <id>-24</id>
                <id>32</id>
                <id>69</id>
                <id>32</id>
                <id>32</id>
            </tsusip>

Is it possible to concatenate the whole byte array in order to store it in one column in a database?
The result could either be the face value concatenated with a delimiter like '2,123,39...' or translated HEX form like '027B27...' .

Labels (3)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Use tFileInputXML to get the values:

0683p000009Lv0m.png

Then use a tJavaRow to load a global variable:

output_row.value = input_row.value;
globalMap.put("result", ((String)globalMap.get("result")) == null ? input_row.value : ((String)globalMap.get("result"))+","+input_row.value);
System.out.println((String)globalMap.get("result"));

Here is the result:

2,123,39,-98,0,0,3,-24,32,69,32,32

Hope this helps.

View solution in original post

1 Reply
TRF
Champion II
Champion II

Use tFileInputXML to get the values:

0683p000009Lv0m.png

Then use a tJavaRow to load a global variable:

output_row.value = input_row.value;
globalMap.put("result", ((String)globalMap.get("result")) == null ? input_row.value : ((String)globalMap.get("result"))+","+input_row.value);
System.out.println((String)globalMap.get("result"));

Here is the result:

2,123,39,-98,0,0,3,-24,32,69,32,32

Hope this helps.