|
I have a report where I have a grouping based on a formula, for example, Levels 1,2,3,4,5,6,7,8,9,10. The report does the grouping as Levels 1,2,4,5,3,6,7,8,9,10. Level 3 is after Level 5. The Group Name formula is below:
if {@Formula_Level}=1 then 'Level 1 - Rookie - 0 Credits Prior Year Total' else
if {@Formula_Level}=2 then 'Level 2 - Candidate - 1-5 credits Prior Year Total' else
if {@Formula_Level}=3 then 'Level 3 - Blue - 6-24 credits Prior Year Total' else
if {@Formula_Level}=4 then 'Level 4 - Life - 25-49 credits Prior Year Total' else
if {@Formula_Level}=5 then 'Level 5 - Green - 50-99 credits Prior Year Total' else
if {@Formula_Level}=6 then 'Level 6 - Red - 100-149 credits Prior Year Total' else
if {@Formula_Level}=7 then 'Level 7 - Royal - 150-249 credits Prior Year Total' else
if {@Formula_Level}=8 then 'Level 8 - Purple - 250-499 credits Prior Year Total' else
if {@Formula_Level}=9 then 'Level 9 - Statesman - 500-1499 credits Prior Year Total' else
if {@Formula_Level}=10 then'Level 10 - All-Time Big Spikes - 1500+ credits Prior Year Total'
Now the formula for @Formula_Level is below:
Switch (
{Command.PY_TotalCredits}<=0, 1,
{Command.PY_TotalCredits}>0 and {Command.PY_TotalCredits}<=5, 2,
{Command.PY_TotalCredits}>5 and {Command.PY_TotalCredits}<=24, 3,
{Command.PY_TotalCredits}>24 and {Command.PY_TotalCredits}<=49, 4,
{Command.PY_TotalCredits}>49 and {Command.PY_TotalCredits}<=99, 5,
{Command.PY_TotalCredits}>99 and {Command.PY_TotalCredits}<=149, 6,
{Command.PY_TotalCredits}>149 and {Command.PY_TotalCredits}<=249, 7,
{Command.PY_TotalCredits}>249 and {Command.PY_TotalCredits}<=499, 8,
{Command.PY_TotalCredits}>499 and {Command.PY_TotalCredits}<=1499, 9,
{Command.PY_TotalCredits}>1499,10
)
I have tried combinations of switch statements and if/then statements in both for formula and the Group Name Formula, but they did not fix the situation.
Any help would be greatly appreciated.
Thanks,
AW
|