Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

New Named Calculation Expression for Case Statement?

$
0
0
Hi,Can any one help with the case statement?The following CASE STATEMENT is the result in my SQL Management.selectColumn1 = case when Column1 = 'true' then 'Y'ELSE 'N'END ,Column2 = case when Column1 = 'true' then 'Y'ELSE 'N'END ,SHARED = case when Column1='true' AND Column1='true' THEN 'SHARED' ELSE 'NOTSHARED'ENDFROM TableRESULT:Column1 Column2 SHAREDY N NOTSHAREDN N NOTSHAREDY N NOTSHAREDN N NOTSHAREDN N NOTSHAREDY N NOTSHAREDY N NOTSHAREDY N NOTSHAREDN N NOTSHAREDY N NOTSHAREDN N NOTSHAREDY N NOTSHAREDY N NOTSHAREDN N NOTSHAREDI have to create a new named calculation using the above statement. How to do it?When I try this it is displaying the error:Deferred prepare could not be completed.Statement(s) could not be prepared.Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

Viewing all articles
Browse latest Browse all 1341