Hi,

I am running this query:

Let(

{

matches: Map(

Paginate(Match(Index(“matches_by_leagueid”), 11517)),

Lambda(“ref”, Get(Var(“ref”)))

),

wins: Map(

Var(“matches”),

Lambda(“match”, If(Select([“data”, “radiant_win”], Var(“match”)),Add(Var(“radiant_wins”),1),Add(Var(“dire_wins”),1)))

),

radiant_wins: 0,

dire_wins: 0

},

Var(“wins”)

)

matches is a array containing true/false bool, so I want to go through matches evaluate if that match has radiant_win = true and add +1 to radiant_wins variable, add +1 to dire_wins if its false.

I am getting:

“code”: “invalid expression”,

“description”: “Variable ‘dire_wins’ is not defined.”

full error:

## Summary

Error: [

{

“position”: [

“let”,

1,

“wins”,

“map”,

“expr”,

“then”,

“add”,

0

],

“code”: “invalid expression”,

“description”: “Variable ‘radiant_wins’ is not defined.”

},

{

“position”: [

“let”,

1,

“wins”,

“map”,

“expr”,

“else”,

“add”,

0

],

“code”: “invalid expression”,

“description”: “Variable ‘dire_wins’ is not defined.”

}

]