Is it possible to filter Items by Subsidiary? When...
# suiteql
d
Is it possible to filter Items by Subsidiary? When I try to do this
Copy code
SELECT * FROM Item WHERE Subsidiary = '1'
I get an empty response. And I have items associated with the Subsidiary Id 1. Am I missing something?
t
You might want to try referring to the Subsidiary as an integer:
SELECT * FROM Item WHERE Subsidiary = 1
c
Using an integer I get a driver error, using
'1'
I get 0 rows. Looks like a bug. Also, joining on the subsidiary table to try and do it that way gives an error. Looks like a bug - I'd file one with support if I were you
d
Was also getting an error using an integer. Thanks for the help! Will mention this to support
c
select distinct trim(subsidiary), subsidiary from item
gives an interesting result. Defo looks like a bug in their driver
Workaround for you if you're interested:
select * from item join subsidiary on subsidiary.name = BUILTIN.DF( item.subsidiary ) where subsidiary.id = 1;
You can also use
where BUILTIN.DF( item.subsidiary ) = 'your awesome company name'
b
i say build the query in the ui, convert it suiteql, and then see what query netsuite uses
d
Those are all great suggestions. Thanks!