Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Error using Expression.Evaluate & #shared for dynamic query refrence

I have a number of different finiancial queries for each quarter and I want to be able to choose which to pull from dynamically.

I attempted to accomplish this like so:

 

Source = Expression.Evaluate("LY-All Branch Summery-Q"&Quarter, #shared)

 

Unfortunatly this threw an error at me:

Expression.Error: [1,8-1,14] Token Eof expected.
Details:
[List]

To Diagnose this I hardcoded the query name, and in another step referenced the query with the more common #"Queryname" approch.

 

let    
    Source = Expression.Evaluate("LY-All Branch Summery-Q1", #shared),
    Source1 = #"LY-All Branch Summery-Q1"
in
    Source1

 

In this query If I go to step 'Source" I get the same error as above. "Source1" however gives me the query as expected.

 

What am I doing wrong here?

Thanks in advance

Joseph

  • this call works just fine

    Expression.Evaluate("#""LY-All Branch Summery-Q1""", #shared)

2 Replies

  • this call works just fine

    Expression.Evaluate("#""LY-All Branch Summery-Q1""", #shared)
  • Anonymous's avatar
    Anonymous
    Not applicable

    Why, it does indeed!

    I was able to use that to make my dynamic names work:

    = Expression.Evaluate("#""LY-All Branch Summery-Q" & Quarter & """", #shared)

    Thanks AlienSx!