Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 maniram23
		
			maniram23
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 PrashantSangle
		
			PrashantSangle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 amit_saini
		
			amit_saini
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Mani,
try this:
Count(DISTINCT CustomerCode)
or
sum(aggr(count( distinct MonthName(Date)), CustomerCode ))
or
=COUNT(TOTAL<Customer> DISTINCT Product)
Thanks,
AS
 PrashantSangle
		
			PrashantSangle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 maniram23
		
			maniram23
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hi
count works in script level ?
 PrashantSangle
		
			PrashantSangle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 amit_saini
		
			amit_saini
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		yes you can , but it should be aggr() function.
Thanks,
AS
 anbu1984
		
			anbu1984
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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; 
