Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I'm trying to look across a couple of columns to determine if a condition is true then report out "Premix". I'm new to PQ and figuring out this type of syntax. Appreciate any assistance.
= if [Medication Name] Text.Contains "minibag" then "Premix" or if [Medication ERX ID] <> 27838 or [Medication ERX ID] <> 9364) then "Premix"
I also tried this initially and it did not work, possibly different arguments needed.
= if [Medication Name] does not contain "minibag" or if [Medication ERX ID] <> 27838 or [Medication ERX ID] then "Premix"
Solved! Go to Solution.
Hi @lepettit ,
Your syntax should be something like this:
if Text.Contains([Medication Name], "minibag") then "Premix"
else if not List.Contains({27838, 9364}, [Medication ERX ID]) then "Premix"
else //your escape clause, like null, "error" etc.
Pete
Proud to be a Datanaut!
A slightly different way would be (you can replace null appropriately)
= if Text.Contains([Medication Name],"minibag") or not List.Contains({27838,9364},[Medication ERX ID]) then "Premix" else null
Thank you, this worked 🙂
A slightly different way would be (you can replace null appropriately)
= if Text.Contains([Medication Name],"minibag") or not List.Contains({27838,9364},[Medication ERX ID]) then "Premix" else null
Hi @lepettit ,
Your syntax should be something like this:
if Text.Contains([Medication Name], "minibag") then "Premix"
else if not List.Contains({27838, 9364}, [Medication ERX ID]) then "Premix"
else //your escape clause, like null, "error" etc.
Pete
Proud to be a Datanaut!