Case condition in SSAS

Shambhu Rai 1,411 Reputation points
2023-06-20T03:03:27.14+00:00

Hi Expert,

 i wanted to use case condition as follows in Sql Server Analysis services -ssas

case when table1.x=1 then winter else table2.b

User's image

expected output

User's image

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
SQL Server Integration Services
SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
SQL Server | Other
{count} votes

3 answers

Sort by: Most helpful
  1. Olaf Helper 47,581 Reputation points
    2023-06-20T05:31:54.4433333+00:00

    i wanted to use case condition as follows in Sql Server Analysis services -ssas

    I guess in a dimension? Model it in the relational database as source, using a CASE WHEN condition:

    https://learn.microsoft.com/en-us/sql/t-sql/language-elements/case-transact-sql?view=sql-server-ver16

    0 comments No comments

  2. Anonymous
    2023-06-20T07:29:47.5133333+00:00

    Hi @In SSAS, you can refer to this post to use the case when statement.

    https://www.mssqltips.com/sqlservertip/3163/mdx-case-statement-examples-for-sql-server-analysis-services/

    Best regards,

    Percy Tang

    0 comments No comments

  3. Shambhu Rai 1,411 Reputation points
    2023-06-23T09:12:21.95+00:00

    in case statement between two tables without direct join not possible

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.