Hello community,
I am trying to concatenate row together but i am finding some diffuculty. I tried a loop but i am missin somtheting. below is a sample data
id
flag
message
indexing
c1
a
ggg
1
c1
hello
1
c1
done
1
c1
b
text tetx
2
c1
answer
2
c1
C
questionquestion
3
c1
answer
3
c1
b
3
c1
v
3
c1
c
3
c2
a
text3
4
c2
text4
4
c2
tex5
4
c2
b
tex6
5
c2
tex7
5
i need 1st to give an index as previwed above then i need to concatenate all rows that are under a certain flag. when the flag is not empty, it means a question, and when it is empty it means asnswers for that question. so i need to group the answers together.
If the goal is to put the answers in separate columns on the same line as the question, then you could always use a row splitter to separate out the rows with an empty Flag, then use the Joiner node to Join them back together by the Index number.
Process As through group loop to add an “AnswerNo” column
Pivot the As: Group => Indexing, Pivot => AnswerNo, Aggregate => message (First) => by adding the running AnswerNo it is ensured that we are not missing anything
Hi @mh_elhassan , are you also asking how to actually create the index column that you have shown? It’s not clear to me if that’s what you want, and I think the answers above generally assume you already have that indexing column… Is that part of the problem?
If so, the creation of the indexing column can be done by using a Rule Engine followed by a Moving Aggregation node as described in the following post
thanks @takbb@PBJ@MartinDDDD@iCFO for your effort
as iCFO answered i need the questions to be in a column and the answers for these questions to be in another single column.each answers with their one question.
there is one question then several lines of answers for that question. i need these lines to be combined in one instead of 2 or 6 rows.
below is the sample output