Untitled.sql
# suiteanalytics
a
Untitled.sql
j
I use Tactical Connect instead of ODBC. It allows me to pull data out via saved searches. Could be worth a shot. www.tacticalconnect.com
a
I just convinced my company to pay 12 grand.
t
@Alan Fitch Could you load the results of the SuiteQL query into a custom record, and then pull from that instead?
a
I need it to be real time. And I really don't want the overhead of another custom record.
s
Just curious, did this work as a direct SuiteQL query? I have wondered what differences there might be between SuiteQL and ODBC with the NetSuite2.com data source. Do you have access to an intermediate database? You could run the individual CTE's, storing their results into temp tables, then combine the results externally. That's not ideal, but might work.
a
Yes. It runs in suiteql.
According to this answer on stackoverflow.com the SuiteAnalytics connecter is limited to sql-92.
t
@Alan Fitch I just took a deeper look at that query, and it looks like you could write it without the CTEs. Sure, it would be tricky, but the hard work is already done.
a
I'm trying to write a python function that can compile queries with CTEs to subqueries.
Off the cuff did you notice anything wrong in the technique I am using to get the average cost as a certain date?
t
I wasn't looking at the logic so much - just the structure of the query itself. It looks like you used CTEs primarily to make the query a little more manageable, which is why I think you could replace those and use subqueries instead. It would just be really ugly.