I would like to build a variable which will be used to add parameters to a url. This new variable (mQ) is based on a lookup of 3 BOOLEAN status fields in the database. For each of these database fields, if the status is TRUE, I want to set a value of blank. If the status is FALSE, I want to set a value to a specific number (1 for completion status 1 field, 2 for status 2 field, 3 for status 3 field). What I've attempted will function but only for the first 2 records sent. At the 3rd record, it sets the variable to be "123" every time thereafter for some reason. What am I doing wrong or what would you do differently?
%%[ VAR @Status1, @Status2, @Status3, @id, @email, @mQ Set @id = [Contact ID] Set @email = email set @Status1 = Lookup(@lookupDE, "Week 1 Complete","Contact ID",@id) set @Status2 = Lookup(@lookupDE, "Week 2 Complete","Contact ID",@id) set @Status3 = Lookup(@lookupDE, "Week 3 Complete","Contact ID",@id) if @Status1 == "true" then Set @StatusA = '' else Set @StatusA = 1 endif if @Status2 == "true" then Set @StatusB = '' else Set @StatusB = 2 endif if @Status3 == "true" then Set @StatusC = '' else Set @StatusC = 3 endif Set @mQ=Concat(@StatusA, @StatusB, @StatusC) if @mq == "" then Set @mQ = 0 endif Set @landingpage = Concat('http://www.foobar.com','?email=',@email,'&id=',@id,'&mQ=',@mQ) ]%%
THIS IS THE HREF that I'm using within the link: