• etl2016 (11/18/2016)


    etl2016 (11/18/2016)


    To quantify further, SELECT X, Y, z, count (*) GROUP BY X, Y, Z HAVING COUNT (*) = 1 should give the GRAIN of "a table" irrespective of its a FACT or DIM or ER table.

    Is this quantification correct?

    If HAVING COUNT (*) = 1, then X, Y, Z collectively is the grain of that table.....agree?

    The grain of a table is better defined by some business terminology than technical SQL terminology. Do you have an existing data warehouse that you inherited without any documentation? If so then some exploration and/or discussion may be needed. The problem with assuming the grain by unique query is that there may be multiple queries that seem to indicate unique combinations of your data, but only one of them was probably intended as the grain.