In this example we'll show you some of the new functions of the WRDS conditional statement builder in Compustat. We’ll use an example that shows how to select a SIC range.

First, in step 2 select “Search the entire database”

 

If you try to activate the conditional statement builder and you haven’t selected any variables yet, you”ll get the following error message.

 

 

So first select variables that you want to use in the conditional statement builder. In this example we select “SIC — Standard Industry Classification Code” and “CONML — Company Legal Name”

 

 

Now you can create a conditional statement. Add a rule and specify that  the company name starts with an A, add a group and add a rule where you specify that the sic code starts with a 2. Add another rule to this group and specify that the sic code starts with a 3. Within this group select “OR”. The query preview should look like this:

 

 

The end result of your query is a list of companies with sic >= 2000 and sic <=3999 (sic starts with 2 or 3) and the company name starts with an A.