Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Is there a way to use group by the same time as where clause?
I'd like to group by field1, resident Table1, but where field2 is 1, and field3 is 4.
May be this:
NewTable:
Load
field1,
Sum(
Resident [Table1]
Where field2 = 1 and field3 = 4
Group by field1;
Yes, you can use both a WHERE and an GROUP BY clause in the same load statement.
LOAD A, B, sum(C) as C
FROM ABC
WHERE C > 0
GROUP BY A, B
;
I am doing this using a load resident, where can I put the where clause?
NewTable:
Load
field1,
Sum(
Resident [Table1]
Group by
field1;
Now where to add below?
where field2=1 and field3=4
NewTable:
Load
field1,
Sum(
Resident
[Table1]
Where
field2=1 and field3=4
Group by
field1
;
May be this:
NewTable:
Load
field1,
Sum(
Resident [Table1]
Where field2 = 1 and field3 = 4
Group by field1;
If you are dealing with large datasets you should better separate where and group by in two loadings - it will be much faster to filter at first the data and then to aggregate them.
- Marcus