Is it possible to use a SuiteQL query as a dataset...
# suiteql
f
Is it possible to use a SuiteQL query as a dataset in SuiteAnalytics?
w
Unfortunately not, AFAIK
z
Wow, it would be a great feature : custom sql for creating dataset, and later use in workbook... Btw, for each dataset (Table1 from workbook) created by UI, it is possible to get underlined SQL... Learned on @tdietrich SuiteQL tool
f
Yeah I saw that in Tim's SuiteQL tool, but it would be awesome to do it the other way around @Zoran R-DATAGRAM!
w
If you just need a plain list you could use this to present your SuiteQL to users. https://netsuiteprofessionals.slack.com/archives/C01FBBZ8PQC/p1699482628306999?thread_ts=1699459438.102189&cid=C01FBBZ8PQC Or re-work it a bit to use grouping in the datagrid component
j
Hey @Zoran R-DATAGRAM are you referring to "SELECT * FROM usrsavedsearch" or is it something different?
z
Honestly, not my solution. I saw it frrom @tdietrich SuiteQL tool. There is an option to retrieve SQL from workbook Table
j
What is the other option?
🤔
z
Other option for what? Above, I wrote it would be cool to have option to create dataset using custom SQL, and later use it with workbook
j
sorry miss understood you!
z
ok
j
I thought you said there was another option to get the data set from the workbook and use it in suiteql
I am looking to do the oposite to be honest, I have a dataset and I want to use it in a SuiteQL query
w
Create a workbook out of it. Include a table in it. Load the workbook with query.load() and the run toSuiteQL() on the returned object.
z
To clarify, @tdietrich made a great SuiteQL tool, and it is free to download source (it is suitelet). There you can fimd how to get sql statement for dataset (workbook table)
@Watz gave a full instructions
j
I've been using @tdietrich awesome tool!! but I have not found that
BTW I am tring to only use sutietalk rest if posible, but I think I will need to use some scripting :S
z
@Juan, ppen the source and try to find an option to activate workbook
j
nothing against scripting, just trying to make the suiteapp less expensive (maintenance and what not )
will do that! thanks!
BTW query.load also supports passing the dataset id directly
no need for a intermediary workbook
TY all!!
Sorry to keep bloating this thread, but I just found something funky with the load().toSuiteQL() the SuiteQL object contains 2 properties, query and params, so if you want to construct the full query you need to account for both, I was going crazy on why it would not return the full sql with the values embedded in the query attr