Focal Point
[CLOSED] Appending BY field value to get result in a single row

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2557036196

September 10, 2019, 12:48 PM
srajeevan
[CLOSED] Appending BY field value to get result in a single row
Hi,

I have a table request from a cluster join.
The output looks as shown below.

Col1 Col2 Col3 Col4 Col5 Col6 Col7
xx    yy   zz   aa   bb   cc   dd
xx    yy   zz   aa   ss   cc   dd 


Only the Col5 is different and upon checking with the database team,it turns that there is nothing wrong with the data.
How can i display only one row with bb and ss appended in Col5.?

If someone can provide any logic to that ,it would be helpful.

This message has been edited. Last edited by: FP Mod Chuck,


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
September 10, 2019, 01:01 PM
BabakNYC
I've no idea what you're trying to do. Could you show us the code and expand on the issue you've run into?


WebFOCUS 8206, Unix, Windows
September 10, 2019, 01:10 PM
srajeevan
Appologies for the lack of detail.


Now when i do
 
TABLE FILE DEMO_CLUSTER
BY Col1
BY Col2
BY Col3
BY Col4
BY Col5
BY Col6
BY Col7
END

I get two rows of data as shown above.
I don't have an actual code to show the output,because it is complex and involves lots of defines and computes.


I am trying to print the out the result into a single row as below.

  
Col1 Col2 Col3 Col4 Col5    Col6 Col7
xx    yy   zz   aa   bb|ss   cc   dd



WF8206,Windows 7,8,10
HTM,PDF,EXCEL
September 10, 2019, 01:14 PM
BabakNYC
Try creating a DEFINE that checks the last value of the column and if it's not the same, concatenates it to itself. Something like
  
IF COL5 NE LAST COL5 THEN ....



WebFOCUS 8206, Unix, Windows
September 16, 2019, 01:42 PM
Doug
Good one. I was about to suggest that... And use the DFINEd field instead of COL5.