Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Buddy, I tried to have a distinct count grouping by 2 fields.
Write below script in the loading script.But I found the distinct didn't work.
TEMP3:
NoConcatenate
Load
[Order Created By Rep]&[Order Year Month] as key,
Count(DISTINCT ([Order Document Number])) as COUNTNUM
Resident FACT_ORDER_FLUID_CONNECTORS
Group BY [Order Created By Rep],[Order Year Month]
Thanks in advance.
Add the Distinct after load or remove the bracket after DISTINCT(
Hello @emilyrabbit
Even if distinct is displayed in black, the result seems to work normally.
The image below is the result of making and processing sample data.
[ Result]
******** No Distinct
[ Result ]
If you share the sample data of "FACT_ORDER_FLUID_CONNECTORS" table
we can think about the problem together.
Be aware that:
[Order Created By Rep]&[Order Year Month] as key,
isn't equally reflected by:
Group BY [Order Created By Rep],[Order Year Month]
and you may need to adjust it to:
Group BY [Order Created By Rep]&[Order Year Month]
Further the combined key has no included delimiter. Depending on the content of the fields there may occur some kind of overlapping.