Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a field called period. i want count to the distinct count in script level . i don't want create in UI level test object.
Hi,
Yes, but it is aggreated function for that you required Group by clause.
Check below test script ;
t1:
LOAD * INLINE [
no,ID
23,1
43,1
54,2
1000,2
99,1
];
t2:
LOAD count(no) as count_no,
ID
Resident t1
Group by ID
;
DROP Table t1;
Regards
Mani,
try this:
Count(DISTINCT CustomerCode)
or
sum(aggr(count( distinct MonthName(Date)), CustomerCode ))
or
=COUNT(TOTAL<Customer> DISTINCT Product)
Thanks,
AS
Hi,
If you need to count in script
then in script add count(fieldname) as count_fieldName,
Note : Count is aggreated function for that you required group by clause.
Regards
hi
count works in script level ?
Hi,
Yes, but it is aggreated function for that you required Group by clause.
Check below test script ;
t1:
LOAD * INLINE [
no,ID
23,1
43,1
54,2
1000,2
99,1
];
t2:
LOAD count(no) as count_no,
ID
Resident t1
Group by ID
;
DROP Table t1;
Regards
yes you can , but it should be aggr() function.
Thanks,
AS
If you need distinct count of a field, you can try like this
t1:
LOAD * INLINE [
no,ID
23,1
43,1
54,2
1000,2
99,1
];
Load Count(DISTINCT ID) Group by Key;
Load 1 As Key,ID Resident t1;