Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have the following code in the load script:
LET vCountCustomers=count(distinct usercode);
But as result i get nothing.
I guess this functionality is not directly available, but if you want, you can calculate Count() in a table load and then store its value in a variable using Peek() function....
Temp:
LOAD count(distinct usercode) as CountCust
Resident SomeTable;
LET vCountCustomers = Peek('CountCust');
DROP Table Temp;
Try it with: LET vCountCustomers = fieldvaluecount('usercode')
- Marcus
I guess this functionality is not directly available, but if you want, you can calculate Count() in a table load and then store its value in a variable using Peek() function....
Temp:
LOAD count(distinct usercode) as CountCust
Resident SomeTable;
LET vCountCustomers = Peek('CountCust');
DROP Table Temp;
Indeed. In a Load Script, aggregation functions like Sum(), Count() Min(), Max() and the others only work if they are used in a LOAD or SQL SELECT statement. AFAIK they don't even work on Fields, just on Table Columns.