Skip to Content

Conditional Join in Graphical Calculation View


We have been struggling to find a graphical solution for a conditional join using case statements (currently we use script based calculation views, as in my example below). As SAP does not recommend using script based calculation views for performance reasons, and to potentially simplify our current models, I am in search for a graphical solution for this conditional join. Here is the script which pertains to the join:


and (a."JOIN_OPTION1" = (casewhen a."JOIN_OPTION1" = 'X' then a."JOIN_OPTION1" else b."REFERENCE_NUMBER"end))

and (a."JOIN_OPTION2" = (casewhen a."JOIN_OPTION2" = 'X' then a."JOIN_OPTION2"else b."CUSTOMER"end))

and (a."JOIN_OPTION3" = (casewhen a."JOIN_OPTION3" = 'X' then a."JOIN_OPTION3"else (ifnull(aj."TOTAL_BUDGET", b."SPENDING")) end))

and (a."JOIN_OPTION4" = (casewhen a."JOIN_OPTION4" = 'X' then a."JOIN_OPTION4"else b."COST"end))

Using "JOIN_OPTION1" as an example, there are 2 options which can occur

  • 1) a."JOIN_OPTION1" = a."JOIN_OPTION1" (X) – this is equivalent to no join since x=x.
  • OR
  • 2) a."JOIN_OPTION1" = b."REFERENCE_NUMBER"-- this being an inner join between table A and table B

For our particular business logic both of these scenarios need to be accounted for. I am unable to screen share. I really appreciate any and all feedback if there is a graphical solution! Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers