How to save a gt table to either an excel or word file - gtsummary

After submitting my beautiful tables to a publisher, they want them in either a word or excel file. Is there a simple way to save a gt table to either format or am I better off just redoing them in excel?

Here are some options for exporting gtsummary tables to excel or RTF:
library(gtsummary)
library(writexl)
gt_table <- trial %>%
tbl_summary()
# Export to Excel ----
# convert to tibble, then write to xlsx
gt_table %>%
gtsummary::as_tibble() %>%
writexl::write_xlsx(., "example_gtsummary1.xlsx")
# Or use `as_hux_xlsx()`
gt_table %>%
as_hux_xlsx("example_gtsummary2.xlsx")
# Export to RTF ----
gt_table %>%
gtsummary::as_gt() %>%
gt::gtsave(., "example_gtsummary3.rtf")
More details about the first option in this post: https://www.pipinghotdata.com/posts/2021-07-14-polished-summary-tables-in-r-with-gtsummary/

I've been looking for a solution to this (specifically how to get GT tables into Excel), and I've just discovered that Excel can open HTML tables. So if you don't have lots of tables, you could just export them all as HTML, open them in Excel and then save them as .xlsx files.

Related

Upload multiple files to pentaho

In pentaho data integration, how do I import a list of xlsx files that are in the same folder?
note: the number of columns are always the same
If your excel column name and sheet name are always same then you can use THIS solution. Here I have take all xlsx file from source folder and convert one-by-one file as csv.
But if your excel columnname and sheet name are dynamic or you need some dynamic solution. Then you can use my another stackoverflow solution from Here

how to export large numbers from HeidiSQL to csv

I use HeidiSQL to manage my database.
When I export grid row to CSV format file, the large number 89610185002145111111 become 8.96102E+19
How can I keep the number without science notation conversion?
HeidiSQL does not do such a conversion. I tried to reproduce but I get the unformatted number:
id;name
89610185002145111111;hey
Using a text editor, by the way. If you use Excel, you may have to format the cell in a different format.

Qlik excel data import for columns with same name

I have 4 different excel sheets and I have been loading them in QlikSense. The common column names get suffix EXPORT WORKSHEET1 . Although I change the name of the sheet after importing, the alias remains the same. How can I change that? Thanks.
I needed to change the name of the sheet within the excel sheet before importing it into QlikSense. Thanks.

Multiple tables with different columns on single BIRT reports

I have a BIRT report with multiple tables with different datasets and number of columns on it. I generate output in .xls and convert into .csv using ssconvert utility on Unix. But in the .csv file I see extra delimiter for tables where there are fewer columns. For example, here is the .csv output with extra "," in .csv file:
table1-- this has only 10 columns
5912,,,0,,,0,,0,,,0,,,0,,,0,,,
tables2 --this has 20 columns
'12619493',28/03/2018 17:27:40,sdfsdfasd,'61901492478'1.08,,,1.08,sdfs,,dsf,,sdfadfs,'738331',,434,,,,,,,333,
I try to put grid but still I see extra ",". I have opened the .xls file and I see it has same issue. The cells in Excel are merged.

Excel 2010 - Pivot using external csv file - how to make dates work?

I have a set of pivot tables that use external csv files as their data sources. The csv files originally contained dates in the format dd/mm/yy (e.g. 31/01/13). The pivot tables did not recognise these as dates. I converted the dates in the csv files to dd/mm/yyyy (e.g. 31/01/2013) but these were still not recognised as dates by the pivot tables.
I tried setting up a calculated field =DATEVALUE(date_from_csv) but when used in the pivot table (I'm using the Max option to select the most recent date) I get #VALUE! errors.
I have tried converting the csv file to xlsx and also importing the data into the workbook that contains the pivot table - but I can't change from the external connection to use the internal data. I don't want to rebuild the pivots as there are a lot of variables and formatting that would take ages to redo.
Any ideas??
The problem was caused by the date column being blank for some rows and I found that if I moved a row to the top (after the header line) that had all the fields filled in, then Excel got the formats correct and the pivot tables now work!