### Cycles comparison | metric | previous cycle | last cycle | | ----------------------------------------------------------- |:-------------- |:---------- | | 1. Unique ```name``` count | 846531 | 863673 | | 2. Unique ```provider_id``` count | 850502 | 867829 | | 3. Unique ```location_id``` count | 1345122 | 1517344 | | 4. Unique ```provider_id``` + ```location_id``` pairs count | 1544333 | 1723247 | | 5. Unique ```displayNationalProviderId``` count | 420693 | 430587 | ### SQL Queries 1. Unique ```name``` count ```sql= select count(distinct data->>'name') from cigna_step_2 where cycle_id = X; ``` 2. Unique ```provider_id``` count ```sql= select count(distinct data->>'providerId') from cigna_step_2 where cycle_id = X; ``` 3. Unique ```location_id``` count ```sql= with b as ( with a as ( select data from cigna_step_3_data where cycle_id = X ) select jsonb_array_elements(a.data -> 'locations') as loc from a ) select count(distinct(b.loc->>'locationId')) from b ``` 4. Unique ```provider_id``` + ```location_id``` pairs count ```sql= with b as ( with a as ( select data from cigna_step_3_data where cycle_id = X ) select jsonb_array_elements(a.data -> 'locations') as loc, a.data -> 'providerId' as pid from a ) select count(distinct(b.pid, b.loc->>'locationId')) from b ``` 5. Unique ```displayNationalProviderId``` count ```sql= select count(distinct data->>'displayNationalProviderId') from cigna_step_2 where cycle_id = X; ```