Knowledge Drop

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

  • 15 June 2021
  • 0 replies
  • 399 views

Userlevel 4
  • Community Admin
  • 30 replies

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.                

 

 

 


0 replies

Be the first to reply!

Reply