Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I don't understand why the 2 results in the use of the count expression is showing, hoping you can explain.
I wanted to get a distinct count of the combination of Product and Order Number. I used 2 aproaches for this this:
1) Combining the fields in the count expression as follows - count(distinct Product&OrderNumber). This was not giving the correct results.
2) Creating a new field that combined the Product and Order number and using a count distinct on the new field - count(distinct [Prod-Ord]). Where Prod-Ord = Product & OrderNumber. This is returning the correct answer which is 9.
Please see attached screenshot for your reference.
what is the result if you use:
count(distinct (Product&OrderNumber))
Hi there,
I have tried count(distinct (Product&OrderNumber))and its providing a count of 10 - same as count(distinct Product&OrderNumber)
FYI, Load editor script as follows:
Temp:
LOAD * inline [
Customer|Product|OrderNumber|UnitSales|UnitPrice|Prod-Ord
Astrida|AA|1|4|16|AA1
Astrida|AA|7|10|15|AA7
Astrida|BB|4|9|9|BB1
Betacab|CC|6|5|10|CC6
Betacab|AA|5|2|20|AA5
Betacab|BB|1|25| 25|BB1
Canutility|AA|3|8|15|AA3
Canutility|CC|||19|CC
Divadip|CC|2|4|16|CC2
Divadip|DD|3|1|25|DD3
] (delimiter is '|');