CASE statement syntax in Information Map Studio

0

CASE statements are a powerful mechanism in SQL code to analysis, recode, etc data. In Information Map Studio, you can utilize this CASE statement via the Expression Editor Window.

Create a new data item and click edit in the 'Expression Settings' area.
From the Categories - CASE operator folder, there are a laundry list of examples for using the CASE statement.
However, note that the functions called 'Case Statement When clause' actually do not include all the necessary components to work correctly in SQL.

Very easy fix. Just add the word 'CASE' in front of your WHEN, and then add the word 'END' after your expression. Here is an example:

CASE WHEN YEAR(<>)=YEAR(TODAY())
THEN SUM(<>)
END

Share

About Author

Angela Hall

Senior Technical Architect

Angela offers tips on using the SAS Business Intelligence solutions. She manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela also has co-written two books, 'Building BI using SAS, Content Development Examples' & 'The 50 Keys to Learning SAS Stored Processes'.

Comments are closed.

Back to Top