XmlAgg function in knime

How can we add a new (derived) column into a data set?

How can we merge many rows values into one row value? In other words, how to apply below script using Knime nodes?

Trim(Trailing ‘;’ FROM (XmlAgg(Trim(WORKITEMID) || ‘;’ ORDER BY CREATIONTIME) (VARCHAR(10000)))) full_steps

Hi there @ahmed_gomaa,

welcome to KNIME Community Forum!

Considering you are just starting with KNIME I recommend you check this Learning page. You will find here a lot of useful content and get answers to above questions.

Also sharing (dummy) input and output data in topic helps you get answer/solution/advice much sooner :wink:

Br,
Ivan

1 Like

Could you please provide the link that explain the XmlAgg() in knime?

I used the GroupBy node with Concatenate(). It appends the values over the key. But, that concatenation doesn’t depend on a special ordering. Like as, create_date. How can I do that?

Hi @ahmed_gomaa -

Do you have a small dummy or toy dataset you could share? As Ivan mentioned, this may help speed the process along if your fellow forumers have data they can play with. It doesn’t have to be much.

2 Likes

Items_Ordering.knwf (10.8 KB)
Here you are. The expected output should be in a specific sequence. for example, key1 should be bb, dd, aa, cc. key2 should be yy, zz, ww, xx. etc.

@ahmed_gomaa,

I’m not aware that KNIME’s GroupBy node offers this functionality. What you could do is add a Sorter node prior to the GroupBy and sort your table according to date.

Best
Mark

2 Likes

I did it yeasterday.

I have been done it yesterday.

@ahmed_gomaa,

does this solution work for you? If so feel free to mark my post as a solution.

Happy Kniming,
Mark

partial solution. i should sort by key and then by date. in groupby i use concatenate function.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.