Michael Hall 4 Posted August 28, 2019 Share Posted August 28, 2019 Hi, I'm trying to create an expression for a calculated column that converts all of my units into megawatts, but with a few extra requirements as follows: If something is classified in a certain way, the result is NULL, so that it doesn't interfere with a weighted average calculation later. If it isn't a given date the result must also be 0 so that it doesn't interfere with the weighted average calc later (this is the problem step) The rest of the calculation just converts all of my other units into Megawatts Here's what I have so far: The [Delivery date] column is"Date" data type, and is in dd/mm/yyyy format. case when [Classification] in ("aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh") then NULL if ([Delivery date]=Date(01/01/2019) Link to comment Share on other sites More sharing options...
Ryan Mireles 2 Posted August 28, 2019 Share Posted August 28, 2019 Try making your [AMT UNIT] its own case Statement "[AMT UNIT SCENARIO]" case when [Classification] in ("aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh") then NULL when [Delivery date]!=Date(01/01/2019) THEN NULL when [Delivery date]=Date(01/01/2019) THEN [AMT UNIT SCENARIO] else 0 END Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now