Focal Point
[CLOSED] Converting Multiple Columns into One

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

September 23, 2019, 01:38 PM
joe.danz
[CLOSED] Converting Multiple Columns into One
I have a hold file created that structures my table as one row with multiple columns, like so:

Param1Name Param1Mean Param1Std Param2Name Param2Mean Param2Std Param3Name Param3Mean Param3Std etc..

I need to format the table as:

ParamName ParamMean ParamStd

Param1Name Param1Mean Param1Std
Param2Name Param2Mean Param2Std
etc...

I'm pretty new to WebFocus, so please explain suggestions!

Thank you!

This message has been edited. Last edited by: FP Mod Chuck,
September 23, 2019, 02:09 PM
MartinY
Using the columns as BY fields should work. Except if we're missing information...

For each value in ParamName & ParamMean & ParamStd it will generate a new line
TABLE FILE abc
BY ParamName
BY ParamMean
BY ParamStd
ON TABLE SET BYDISPLAY ON
END


Please use the code tag when posting sample data or code
It's the last icon on the ribbon that looks like the below
</>



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 24, 2019, 04:44 AM
Frans
In this case you can use OVER:

TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS TST
END

TABLE FILE TST
PRINT
 CAR AS ''
 MODEL AS '' OVER
 COUNTRY AS ''
 SEATS AS ''
END
  



Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
September 29, 2019, 02:33 PM
Doug
So, each row in your source file can have a different amount of 'groups' of data, as in "Param1Name Param1Mean Param1Std" to "Param#Name Param#Mean Param#Std", where the '#' can vary from 1 to 'a lot'?
If so, you may be able to loop thru it to break it down.