It may just be too long. Pretty sure there is a character limit to variables. Maybe try breaking it up into multiple variables then combine into a final variable that you use in your report.
if you really want to check 2000 conditions in that way,
you should urgently attend a data-modeling/reporting course
or you are bored and want to kill the time
Is this set of variables that can be merged latter? if yes, we did so but some lines disappeared for unknown reason. I believe I did the single variable method with OR statement few years back, but I can not remember what I did at that time, and I can not find that report as well.
Upload the spreadsheet to BO, add this to your report as datasource
and merge the key-value with your report.
Pay particular attention to consistency of the key-values (e.g. additional blanks, upper/lower-case, number-formatting) !
If there are differences, create variables with the logic of cleaning the values and merge these variables instead of the original value.
Data only get lost in merging if there is no exact matching partner !
If you don’t want to have an external datasource in Excel or can’t add this to you database, you can use groups which are effectively CASE statements. However, you have to check for new values each time you refresh the report and it’s just for a single report which means it’s easy to be inconsistent between reports.
Given that IDs are not very descriptive, I’d concatenate the ID with a descriptive element, insert that in the report and group the concatenated variable.
Check your logic. You’re missing a case/if somewhere. Build in stages. Display each variable in your report, temporarily, to help troubleshoot.
As others have said, variables are not the best solution for this. Especially since you mention you’ve had to use the same logic before - reuse/recycle! If you have a large dataset, you’ll likely see a performance hit.
= If [Item Id] <= 1999 Then
(If [Item Id] = 1 then “A” elseif
… till end of first 2000 conditions
[Item Id] = 1999 then “ZXZ”
) ElseIf
[Item Id] >= 2000 And [Item Id] <= 4000 Then
(If [Item Id] = 2000 then “ABC” elseif
… till end of second 2000 conditions
[Item Id] = 4000 then “ZZZ”
)
Else “–”
However, in my new condition the [Item Id] is not numerical, so I’m confused how I can modify the above code to handle the huge number of conditions in single variable using the IF else statement.
Thank you for your replies, and hope we can find a solution for this request,
Ahmed Moursi