Forum Discussion

smpa01's avatar
smpa01
Community Champion
5 years ago
Solved

How to handle space in SSAS Query

Hi,

I have an Analysis Service Query as following where I am querying a SSAS table called - Chart of Accounts like following

 

 

AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/XYZ", "Price Accuracy_dmOnly", [Query="EVALUATE Chart of Accounts", Implementation="2.0"])

 

 

 and it returns the following errror

 

 

DataSource.Error: AnalysisServices: Query (1, 16) The syntax for '<pii>of</pii>' is incorrect. (<pii>EVALUATE Chart of Accounts</pii>).

 

 

 However, if I delete the space in the table name and change it to CoA and query, it perfectly works

 

 

AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/XYZ", "Price Accuracy_dmOnly", [Query="EVALUATE CoA", Implementation="2.0"])

 

 

 

I would not have mind doing this manually if it was for a small number of tables. But I am querying almost 15 SSAS tables for a new analysis and I don't want to change the table name manually in the model cause it might break something somewhere else.

 

Is there any way to handle space for SSAS table name in the query window itself.

 

Thank you in advance.

 

 

  • You can try putting quotes around table name 

    e.g. EVALUATE 'Chart of Account'

     

    Regards,

    Sayali 

    If this post helps, then please consider Accept it as the solution to help others find it more quickly.

2 Replies

  • You can try putting quotes around table name 

    e.g. EVALUATE 'Chart of Account'

     

    Regards,

    Sayali 

    If this post helps, then please consider Accept it as the solution to help others find it more quickly.