Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in BI by (17.6k points)

Can some one please tell me how to re-write the below case statement in SSRS?


CASE

WHEN ACTUAL_PERFOMANCE_MIN_BECHMARK > 0

THEN ACTUAL_PERFOMANCE_MIN_BECHMARK * 500

ELSE

CASE

WHEN ACTUAL_PERFOMANCE_TARGET_BECHMARK < 0

THEN ACTUAL_PERFOMANCE_TARGET_BECHMARK * 300

ELSE 0

END

END

1 Answer

0 votes
by (47.2k points)

Case statement is basically one of the widely used program flow statements. It allows us to control the program flow and it’s output when we have more than two flows/conditions to set. In other words, case statement is an optimized version of nested If statement.

Case statement in SSRS is a decision function that can be reached through expressions. Keyword for case statement in SSRS is Switch, and not case like in other similar technologies.

Syntax for case statement in SSRS:

Switch(Expression as Object)

 You can either use Nested IIF or Switch

Example for Switch

Switch(Fields!ActualPerformanceMinBenchmark.Value>500,Fields!ActualPerformanceMinBenchmark.Value*500,Fields!ActualPerformanceTargetBenchmark.Value<0,Fields!ActualPerformanceTargetBenchmark.Value*300,0)

Example for IIF

iif(Fields!ActualPerformanceMinBenchmark.Value > 0, Fields!ActualPerformanceMinBenchmark.Value*500,iif(Fields!ActualPerformanceTargetBenchmark.Value<0,Fields!ActualPerformanceTargetBenchmark.Value*300,0)) 

You can learn ssrs from Intellipaat

Related questions

0 votes
1 answer
0 votes
1 answer
asked Feb 27, 2020 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
0 votes
1 answer
asked Feb 27, 2020 in BI by Vaibhav Ameta (17.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...