Having both chisq.test and fisher.test in a tbl_summary table - gtsummary

Is it possible to have a tbl_summary table with a "chisq.test" when expected cell counts >=5 and "fisher.test" when expected cell counts <5 without merging two separate tables? If so, how would script it?

Related

Compare two sql data using mysqlworkbench

I have 3 tables on mysqlworkbench, 1 table need to combine with 2 data ch(17million row) and cl(9million row) suppose to be one table, other table name alldoc.(121k)
Basically i need to combine ch and cl as one table, and compare with alldoc data. Technically they are suppose to be same but people made mistake that why i need to compare. 100 column
enter image description here
enter image description here
I plan to write query till i hit to 100 because i have 100 columns in all data. Just rows sizes are different.
Thank you from advance. I know complicated but i really need to compare these two data writing query

Exclude Combination of Data Items From One Table From Another

I have a view, A, with 20 columns which forms my primary data. I have a table B which lists some of the columns from A and contains data I want to exclude from A.
For example table B will have 6 columns 2 of which are 'customer' and 'country' and contain the data 'HP' and 'America'. These columns exist in A. But I want to write a query that brings back data from A except where any rows that have a combination HP and America.
There are 6 columns and table B can have any combination of rows. Anywhere between 1 and all 6 rows could be filled in or there could be a row which has 5 columns filled in. Also another row with a different 5 columns filled in and so on.
I want to be prepared for any possible combination of the 6 rows and the query to search A for the combination and exclude any rows with that data from B.
I have tried this
SELECT *
FROM A T1
WHERE not EXISTS
(SELECT * FROM [dbo].[ExcludedItems] T2
WHere ReportNumber=1
AND
(
T1.job=ISNULL(T2.job,T1.job) and T1.CustomerName=ISNULL(T2.CustomerName,T1.CustomerName) and
T1.COUNTRY= ISNULL(T2.COUNTRY,T1.COUNTRY) and T1.CONTINENT=ISNULL(T2.CONTINENT,T1.CONTINENT) AND
T1.continer= ISNULL(T2.ContainerName, T1.continer) and T1.UnscheduledJob= ISNULL(T2.unscheduledJob, T1.UnscheduledJob) and
T1.[Price]= ISNULL(T2.Price, T1.Price) and
T1.[Haulage]= ISNULL(T2.[Haulage], T1.[Haulage]) and
T1.SiteAdress= ISNULL(T2.SiteAddress, T1.SiteAdress) and T1.Delta=ISNULL(T2.Delta, T1.Delta) and
T1.Cost= ISNULL(T2.Cost, T1.Cost)
)
)
The problem is the result set is not correct. I have tried with a smaller column sample and able to exclude the correct combination of Customer and Country but when I introduce a 3rd or 4th column combination I can eyeball the result set and immediately see its incorrect. Not sure if I have to use multiple NOT EXISTS for each possible combination, was hoping not to.
A constraint is A has to be a view not a table. Otherwise I would have used variables in some manner and wrapped the whole thing in a stored procedure.
Appreciate any help, fall back is to manually add to the code each time an item combination is supplied in B!

Soft artisans ExcelWriter Data Binding - Insert Cells Instead of Rows

According to the article
http://wiki.softartisans.com/display/EW8/How+ExcelWriter+Inserts+Rows
ExcelWriter inserts a new row for every row in the dataset. What if my dataset has 5 columns, for each row, I want ExcelWrite just to insert 5 cells and only expand the table for those 5 columns, not the entire row. Is it doable? Thanks.
I do not believe ExcelTemplate has this functionality. I believe ExcelTemplate will always insert a new row.
If you can use ExcelApplication, Import Data may work for your needs. It can be done on an area or a worksheet.
See http://wiki.softartisans.com/display/EW9/Area.ImportData and
http://wiki.softartisans.com/display/EW9/Worksheet.ImportData

2 Table Rows per 1 Database Table Row

I'm working on a table in iReport designer where I pull in info from a database. As of right now, I have it so that one row of the table corresponds to one row in the database.
How can I make it so that one entry in the database can take up two rows. The first row would have 4 columns corresponding to a field in the database. The second row would have 1 column the same length as the 4 above columns combined and also correspond to one field. When editing an iReport designer table, there doesn't seem to be an option to add more rows, only columns.
I found a much easier workaround. I created a one column table, then dragged and dropped static text and fields in certain spots to make the report look like it had multiple columns.

SSRS Tablix Row Number into different Tablix

I've got an SSRS report with two tables. In the first table, I've got a row number column, that is calculated based on the RunnningValue for the CountDistinct on the tablix.
What I need, is a row number column in the second table, that begins with the next number after the last number in the first table. So, if table 1 has 15 rows, table 2 should begin at 16. I figure i can do another RunningValue + the max value from the other table, but no idea how to get that Max number into the second table. Is this even possible?
I think I got it. I did a CountDistinct on the field the other table was grouped on, and that gave me the correct number.