Make a fake dimension (hard code value) in SQL Server

Knowledge Drop

Last tested: Apr 2, 2020
 

In many cases, we want to make a fake dimension, so it could act as a variable for table calc.

dimension: name {

type: number

sql: 1 ;;

}

This works perfectly in MySQL yet it will run into an issue with SQL Server, so we would need to twist the syntax a bit

dimension: name {

type: number

sql: CASE WHEN id IS NOT NULL THEN 0.003300 ELSE 0 END ;; }

This content is subject to limited support.                

Version history
Last update:
‎06-14-2021 06:16 PM
Updated by: