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 , October 07, 2019 03:01 PM 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
</> 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
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.