SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Filter Rows in SAS Viya Data Studio on a column name containing spaces

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 18
Accepted Solution

Filter Rows in SAS Viya Data Studio on a column name containing spaces

While trying to import a sas dataset (sas7bdat) in Viya (Prepare / Manage Data) and load into CAS:

 

I turn on the filter rows option on.

 

Using instructions in http://documentation.sas.com/?cdcId=dprepcdc&cdcVersion=2.1&docsetId=datahub&docsetTarget=p1sv89vo4n...

 

I have tried various options on a sample dataset "Digital Clickstream Data" - such as 

 

"State Region" = "Georgia"

'State Region' = "Georgia"

"State Region" = 'Georgia'

 

The problem is - the WHERE condition works perfectly for cases where there are no spaces in the column name (e.g. City="Placintas") however, I get zero rows (no error) whenever I try to use a column name which contains spaces.

 

thanks

 

image.png


Accepted Solutions
Solution
‎02-23-2018 10:16 AM
Occasional Contributor
Posts: 18

Re: Filter Rows in SAS Viya Data Studio on a column name containing spaces

Posted in reply to Rushikesh

Thanks,  Rushikesh , and apologies to LinusH - I must have messed up earlier. Glad to know that this works.

View solution in original post


All Replies
Super User
Posts: 5,852

Re: Filter Rows in SAS Viya Data Studio on a column name containing spaces

Posted in reply to SundareshS

Not sure about Viya, but in SAS9, you can use the name literal:

'State Region'n

Data never sleeps
Occasional Contributor
Posts: 18

Re: Filter Rows in SAS Viya Data Studio on a column name containing spaces

Thank you - however this did not work  - either with double quotes or single quotes.

 

The attached error might explain better - basically the Filter Row condition is packaged into a WHERE clause, and this seems to be an incorrect syntax.

 

I tried another method - made use of the Viya Filter Data task (in SAS Studio) and obtained the code behind it - however, that still makes use of the ' 'n method for variables with spaces. 

 

This somehow does not seem to work in SAS Data Studio/ Daimport_space_error.pngta Preparation.

New Contributor
Posts: 4

Re: Filter Rows in SAS Viya Data Studio on a column name containing spaces

Posted in reply to SundareshS

Hi Sundaresh,

 

I tried to apply filters on similar variable with spaces in variabe name and this is how it worked for me-

 

 

Condition: 

 

'Team Name'n = 'Atlanta'

 

Please check attached screenshots.

 

pic1.jpgpic2.jpg

Solution
‎02-23-2018 10:16 AM
Occasional Contributor
Posts: 18

Re: Filter Rows in SAS Viya Data Studio on a column name containing spaces

Posted in reply to Rushikesh

Thanks,  Rushikesh , and apologies to LinusH - I must have messed up earlier. Glad to know that this works.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 284 views
  • 0 likes
  • 3 in conversation