Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If anyone can help I would appreciate it.
I have data that is one different rows of the table, but the have a common cell in the data.
And I would like to shows case it next to eachother instead of having different rows.
Example:
OUTPUT:
Alternate info | Info | Info | Info |
Test | Random data 1 | Random data 2 | Random data 3 |
Input | |
Alternate info | Info |
Test | Random data 1 |
Test | Random data 2 |
Test |
Random data 3 |
there are at least two general answers to this.
the first one is involved and requires more analysis as you may want a scalable solution - what are you trying to accomplish? how large is your data? do you need an optimized UI? etc..
the 2nd is straight forward, a direct answer to a specific question.
the reason i brought that up is that sometimes the straight forward asnwer is not always the best answer as it drives other problems down the road.
having said that, my simple answer is this:
1. concatenate the info column grouped by alternate column:
NoConcatenate
NewTable:
load [Alternate info], concat(info,'|') as infoS
resident originalTable
group by [Alternate info];
this will result in the following table:
test | info1|info2|info3 |
test2 | info4|info5|info6|info7 |
2: in your table you have no choice but to create the maximum number of columns needed to cover all your concatenated field + the 1st field. if the number of INFO fields is fixed then it is simpler, but if the number of fields is not consistent then you will have to add a condition to show or hide each field depending on the length of the concatenated field.
for the fist concatenated field:
subfield(InfoS,'|')
here is a sample you can see the expressions:
there are at least two general answers to this.
the first one is involved and requires more analysis as you may want a scalable solution - what are you trying to accomplish? how large is your data? do you need an optimized UI? etc..
the 2nd is straight forward, a direct answer to a specific question.
the reason i brought that up is that sometimes the straight forward asnwer is not always the best answer as it drives other problems down the road.
having said that, my simple answer is this:
1. concatenate the info column grouped by alternate column:
NoConcatenate
NewTable:
load [Alternate info], concat(info,'|') as infoS
resident originalTable
group by [Alternate info];
this will result in the following table:
test | info1|info2|info3 |
test2 | info4|info5|info6|info7 |
2: in your table you have no choice but to create the maximum number of columns needed to cover all your concatenated field + the 1st field. if the number of INFO fields is fixed then it is simpler, but if the number of fields is not consistent then you will have to add a condition to show or hide each field depending on the length of the concatenated field.
for the fist concatenated field:
subfield(InfoS,'|')
here is a sample you can see the expressions: