Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Writing SQL Queries

Reply
New Contributor
Posts: 4

Writing SQL Queries

Dear All,

I want to create report which has booking and payment details within a time period. I have import tables supplier master, booking master & payment master in LASR lib. Now tell me how can I write custom query to pass date range for booking and payment and how I can use its output for designing a report. 

Super User
Super User
Posts: 9,866

Re: Writing SQL Queries

Posted in reply to dearshukla

This is not a contract work site, just a Q&A board.  If you have specific questions, please post them, showing test data, what you want out, hat you have tried etc.

To learn things, there are many resources out on the web, there is the SAS videos:

http://video.sas.com/

For SQL:

https://www.w3schools.com/sql/

 

As for designing a report I thought VA was made to make it as simple as possible to create reports?

New Contributor
Posts: 4

Re: Writing SQL Queries

Hi,
I don't want to show any test data also not want to learn SQL. I have sql query near by 102 lines which give me, my required data.
Is it possible to write same query in SAS? I have already imported all related tables in LASR Library.
Super User
Posts: 5,922

Re: Writing SQL Queries

Posted in reply to dearshukla
If that query is from Data Builder it's already executing in "SAS".
But why don't you just try?
Data never sleeps
New Contributor
Posts: 4

Re: Writing SQL Queries

hi,

Presently I am doing same. 

First I am creating & executing view query and saving result as a data table.

I have also tried to unlock the code and tried to write sql query but I didn't get success.  

Is there any other way to write sql query for data.

Super User
Posts: 4,031

Re: Writing SQL Queries

Posted in reply to dearshukla

The usual way to prepare data for SAS VA is to do it in traditional SAS outside of VA. There you can write any SQL or SAS code.

 

One way to define a date range would be to create a SAS table containing the dates you want. You then load that into LASR and use it to populate filters, sliders etc. Another way is to create a calculated item inside VA when you a building a report.

 

 

Super User
Posts: 5,922

Re: Writing SQL Queries

Posted in reply to dearshukla
Ah the objects within VA doesn't generate any SAS code, hence you cannot insert your own query.
As stated, SQL is used to prepare data for VA/LASR. Not in LSR/VA.
Data never sleeps
New Contributor
Posts: 4

Re: Writing SQL Queries

How can I use SQL to query for data preparation? When we use design then SAS generate code automatically. But for manual query there is no option to doing this. Is any there any way to prepare data by manual query?

Super User
Posts: 4,031

Re: Writing SQL Queries

Posted in reply to dearshukla

SAS Studio is the interface you can use in SAS VA to write SQL code as well as traditional SAS code. It comes as standard with SAS VA. You can also use SAS Enterprise Guide if that is available to you.

Ask a Question
Discussion stats
  • 8 replies
  • 196 views
  • 0 likes
  • 4 in conversation