I am trying to create a flag to mark items as distinct. I have a number of null values in TargetSSDateAdd, TargetSkuInv, and TargetSkuStoreInv. These fields may also contain a number of valid values. I need the flag to mark rows with the Max of these values, and then Null if there are no values. I cannot replace null with a fake value as these fields are used in other analysis. (e.g. replace null dates with 1/1/9999)
If Max(TargetSSDateAdd) = Null, return Null, else return Max(TargetSSDateAdd)
If Max(TargetSSDateAdd) = '',0,Max(TargetSSDateAdd))
The above worked for what I was looking to do; however, I ran into more problems with trying to use this logic. I was trying to join two tables where the fields being matched up were null--from what I found, this is not possible. Instead, I created a temporary field (which masked the null values) in my main table, and then pulled that value into my temporary table as well.
Here is a sample of what I did:
Left Join (CPMPOG)
If(Len(inactive_date) = 0, Timestamp('9/9/9999'), Timestamp(inactive_date)) as temp_inactive_date