Skip to content
Advertisement

How can I select multiple columns while using “when” statement

Here is the syntax I wanted to use for “loan amount” column. I am creating a data set on ssas for reporting. But I am having a problem adding “loan id” column based on the syntax since I need both “loan amount” and “loan ID” in the same data set. How can integrate “LOAN ID” while keeping the syntax below for “loan amount”?

Advertisement

Answer

If you only need to add LOAN_ID, you just separate each column with a comma after the SELECT and before the FROM. Also, in this case the “DISTINCT” keyword is not necessary since every LOAN_ID will be unique, and therefore distinct.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement