=SWITCH(
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = "-1","NA",
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = "0", Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Created.Value,"Dataset1"), ","),",").GetValue(0)),
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = "1",
Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Created.Value,"Dataset1"), ","),",").GetValue(1),
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = "2",
Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Created.Value,"Dataset1"), ","),",").GetValue(2)
)
Below is my logic in this switch condition I am trying to implement below logic but each time only highest index value is returning for different arrays.
Array used for below 1 point = []
Array used for below 2 point = ["1st value"]
Array used for below 3 point = ["1st value" , "2nd value"]
Array used for below 4 point = ["1st value" , "2nd value" , "3rd value"]
1. If some value is not found in array then array index of is returning -1 and it should print NA as per logic in switch.
2. If some value is found on array index 0 then array index of is returning 0 and it should fetch created date of index 0 (1st value)
3. If some value is found on array index 1 then array index of is returning 1 and it should fetch created date on index 1 (2nd value)
4.If some value is found on array index 1 then array index of is returning 2 and it should fetch created date on index 2 (3rd value)
But currently it is returning 3rd value only for point 4 where array length is 3 but for others it is returning error where array length is 2, 1 or 0 because it is checking length 3 there as well don't know why Ideally it should work based on array index condition.
```
`=SWITCH(
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = -1,"NA",
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = 0, Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Created.Value,"Dataset1"), ","),",").GetValue(0)),
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = 1,Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Created.Value,"Dataset1"), ","),",").GetValue(1),
Array.IndexOf(Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Team.Value,"Dataset1"), ","),","), "Some xyz Value") = 2,Split(Join(LookupSet(Fields!ID.Value,Fields!ID.Value,Fields!Created.Value,"Dataset1"), ","),",").GetValue(2)
)`
```
Does anyone is having a solution or fix for this . Thanks in advance