Skip to content

Commit

Permalink
Merge pull request #47 from leoebfolsom/lf/compare-all-columns
Browse files Browse the repository at this point in the history
add column_name to output of compare_column_values
  • Loading branch information
joellabes authored Jul 25, 2022
2 parents 6039d2a + 36de39a commit 56b7ed6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion macros/compare_column_values.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ joined as (

aggregated as (
select
'{{ column_to_compare }}' as column_name,
match_status,
match_order,
count(*) as count_records
from joined

group by match_status, match_order
group by column_name, match_status, match_order
)

select
column_name,
match_status,
count_records,
round(100.0 * count_records / sum(count_records) over (), 2) as percent_of_total
Expand Down

0 comments on commit 56b7ed6

Please sign in to comment.