Skip to main content

For me, the output is not clear -

 

  1. Given 'A' has 4 unique combinations (Munich - DE, NH, UK, TN) - as expected
  2. Given that 'B' has 0 unique combinations. As per my understanding, the O/P I expect is 3 (Berlin - DE, UK, TN)
  3. Given that 'C' has 1 unique combination (Berlin- NH) - as expected
  4. Given that 'D' has 0 unique combinations - as expected (all the unique combinations wrt Berlin - DE, NH, UK, TN are covered in the B and C Cases).
  5. Given that 'E' has 3 unique combinations (Bristol - DE, NH, UK) - as expected
  6. Given that 'F' has 2 unique combinations. As per my understanding, the O/P I expect is 1 (Bristol - TN) - as the combinations (Bristol - DE, NH, UK) are covered in the case of 'E' above.

 

 

Can you please correct me if my understanding of the concept is wrong? Also please provide your inputs.

 

image

How are you getting  (Berlin - DE, UK, TN) ?

 

The combination you need to look at is row wise

 

B has Berlin - DE (row number 2) and D has Berlin - DE (row number 4) hence both are 0

 

Now if you keep looking row wise you will get unique value for the combination of City and Country and hence C has Berlin -NH hence 1, F has Bristol- TN hence 2, etc... only repetition was B and D as mentioned above.


Hi @abhinav.singa11,

it is important to know that The number that gets assigned to each unique tuple of city and country does not follow a particular pattern, if the combination is unique so it will get a unique number , if not like the Berlin-DE combination we get a repeated 0, that's why to get the distinct number of combination of city and country they used

COUNT ( DISTINCT UNIQUE_ID ( "Vendors"."City" , "Vendors"."Country" ) ) on the documentation


How are you getting  (Berlin - DE, UK, TN) ?

 

The combination you need to look at is row wise

 

B has Berlin - DE (row number 2) and D has Berlin - DE (row number 4) hence both are 0

 

Now if you keep looking row wise you will get unique value for the combination of City and Country and hence C has Berlin -NH hence 1, F has Bristol- TN hence 2, etc... only repetition was B and D as mentioned above.

Hi Abhishek,

 

Thnk you for the explanation and correction


Hi @abhinav.singa11,

it is important to know that The number that gets assigned to each unique tuple of city and country does not follow a particular pattern, if the combination is unique so it will get a unique number , if not like the Berlin-DE combination we get a repeated 0, that's why to get the distinct number of combination of city and country they used

COUNT ( DISTINCT UNIQUE_ID ( "Vendors"."City" , "Vendors"."Country" ) ) on the documentation

Hi Rashid,

 

Thank you for the explanation


Reply