Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone!
So I have this table:
table:
Load * inline [
name, branch
a, london
a, coventry
b, london
c, london
]
I need to create a filter that only shows the names that have more than 1 branch
Thanks!!!
Hi,
you could try with something like this:
Left Join
LOAD
name,
If(Count(DISTINCT branch)>1,1,0) AS Flag
Resident table
Group By
name
;
Thanks for the reply, although a where clause is needed in order to insert a group by. The solution would look like this:
Left Join
LOAD
name,
If(Count(DISTINCT branch)>1,1,0) AS Flag
Resident table
where
name
Group By
branch
;