Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to count the id field on a table only if the field type=1. I need it in the load script, but I am getting an error.
Table:
Load
If(type=1,count(id),0) as field1
sql select * from ...
Is there a way to do this?
Thank you,
Juan.
Count works fine in the Load script, but you need to use a Group By clause, e.g
Load
type,
Count(id) as field1
Where type = 1
Group By type
;
sql select * from ...
HIC
I not sure what are u trying to achieve from this..
but you can calculate the count of field in sql script
Load field 1;
SQL Select Count(field) as field1
where type =1;
Hi.
try this: if(type=1,1,0) as field1
and then in the graphics you should use count (fiel1).
Regards.
Hi
Try to set the Flag for Type = 1 like this
if(match(Type,1),'Y','N') as Type1
and then use your flag in expression like
count({<Type1 = {Y}>}Type)
Thanks.
Count works fine in the Load script, but you need to use a Group By clause, e.g
Load
type,
Count(id) as field1
Where type = 1
Group By type
;
sql select * from ...
HIC