There are few fields in the Data Extension DeptID, BusinessID, StateID. I want it to print the value only if that value is present in the DE.
Eg, if the DeptID is blank/null it should print BusinessID and StateID(If they are present in the DE) or else a message like "Invalid". But if the DeptID is not present it should not display comma(,) like 456, 789 where 456 is the BusinessID and 789 is the StateID
If all 3 are present then it should print something like 123,456,789. I am totally new to AMPScript and not sure how to lookup and achieve this? Can I use for loop, if yes how?