Hello Leo,
You haven't defined the number of elements in the KPI_YTD array.
Before you assign a value to the element add the syntax redim preserve KPI_YTD[I]
So
Select {Country}
Case "Japan":
redim preserve KPI_YTD[I]
KPI_YTD[I] := (sum({Amount}, {Region})
Regards,
Graham