EHDEN / CatalogueExport

Exports the data from the OMOP-CDM that is necessary for the EHDEN Database Catalogue
Apache License 2.0
9 stars 6 forks source link

Rounded values always 100 for some analyses #41

Open MaximMoinat opened 2 years ago

MaximMoinat commented 2 years ago

There are unintended calls to count_big of an already summed total in analyses queries that also calculate a numerical distribution. This issue was found in 25 analyses. E.g. analysis 406: https://github.com/EHDEN/CatalogueExport/blob/066b8e7005890ae916e19a92a61c815e1fec7ff8/inst/sql/sql_server/analyses/406.sql#L46

count_big(int) will always return 1, which rounds up to 100. (due to some quirks, I have also sometimes seen values of 200)

The equivalent Achilles analysis query does not contain a count at this level.

MaximMoinat commented 2 years ago

Proposed fix: remove count_big of a total.