I have a BAQ that returns part from a selected vendor and displays the last PO date, I’ve been asked now to make it so that if a part from that vendor has not been ordered then the last PO date column should be blank, how do I make my calculated field to say if purchased before display last PO date if not then leave blank?
I’m assuming I need to use a condition in the calculated field but not sure of how to string it all together.
Case
when SubQuery3.PartXRefVend_LeadTime <> 0 then SubQuery3.PartXRefVend_LeadTime
when SubQuery3.VendPart1_LeadTime <> 0 then SubQuery3.VendPart1_LeadTime
else 0
end
You can’t set another field in the calculated field, so on the else, you need to get rid of the field you are trying to set, and just make it null.
Depending on the field, you might not be able to make a date field null. You might have to case it to a character field to get that to work, and obviously that means losing some of the dateyness of the field, so that’s a tradeoff.
Got it! changed join type on my toplevel between PartPlant and SubQuery from matching “Rows from PartPlane and SubQuery2” to “All Rows from PartPlant and SubQuery2” and bingo it worked! Thank you very much