Desktop productivity for business analysts and programmers

Computed column is blank in SAS EG 4.1

Reply
New Contributor
Posts: 4

Computed column is blank in SAS EG 4.1

Hello,
I'm joining 4 tables using a left join. 1 table has Salary by quarter (left table) and the other 3 tables have different expenses by quarter. I want to join them so that I could calculate:

Gross margin = Salary - Expesne1 - Expense2 - Expense3

My gross margin works great if I have the same quarter match in all 4 tables.

My gross margin turns blank whenever I don't have a match for that quarter in all 4 tables. It lists the Revenue and the expenses but it won't calculate gross margin.

How do I fix it?

thanks!
Super Contributor
Posts: 578

Re: Computed column is blank in SAS EG 4.1

Gross_margin = coalesce(Salary,0) - Coalesce(Expense1,0) - Coalesce(Expense2,0) - coalesce(Expense3,0)
New Contributor
Posts: 4

Re: Computed column is blank in SAS EG 4.1

This works great.

Thank you very much.
Ask a Question
Discussion stats
  • 2 replies
  • 112 views
  • 0 likes
  • 2 in conversation