title: "Invalid column name" In SQL Server from OpenQuery to SSAS with flattened results
body: <p>I run the following query in T-SQL with LINKED_AS being my SSAS. </p>
  
  <pre><code>SELECT * FROM
    (SELECT * FROM OPENQUERY(LINKED_AS, 
      'SELECT FLATTENED PredictTimeSeries([PredictColumnName], -3, 0) 
        FROM [Foo]') AS a
    ) AS b
  </code></pre>
  
  <p>and everything works perfect.</p>
  
  <p>But if I want to use just one of the returned columns (it returns PredictColumnName and $TIME), how do I access them?</p>
  
  <pre><code>SELECT PredictColumnName FROM
    (SELECT * FROM OPENQUERY(LINKED_AS, 
      'SELECT FLATTENED PredictTimeSeries([PredictColumnName], -3, 0) 
        FROM [Foo]') AS a
    ) AS b
  </code></pre>
  
  <p>does not work, and I've tried a lot of combinations with alias and such, but haven't managed.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Found out the answer, the way to select is like this</p>
  
  <pre><code>SELECT b.[Expression.PredictColumnName] FROM
    (SELECT * FROM OPENQUERY(LINKED_AS, 
      'SELECT FLATTENED PredictTimeSeries([PredictColumnName], -3, 0) 
        FROM [Foo]') AS a
    ) AS b
  </code></pre>
  
  <p>I got confused by "." being a part of the column name.</p>