I am trying to write an AMP script where I need to display Category types based on different Category's. The column may contain multiple categories, thus the output should be all category types concatenated.
For Eg:
The contact may or may not have multiple categories assigned to them in one column separated by ';' I need to display the text under category type column for respective category, if contact has multiple categories it should display all associated Category Type texts. Below is the sample AMP script I build, but there will be lot of combinations to cover all of it, is there any simple way to do it?
%%[
var @emailSub, @Category
set @Category= [Category]
IF @Category == 'AB'
THEN
set @emailSub = "Text for AB"
ELSEIF @Category == 'BC'
THEN
set @emailSub = " Text for BC"
ELSEIF @Category== 'AB;BC'
THEN
set @emailSub = "Text for AB " + "Text for BC"
ELSEIF @Category== 'AB;BC;CD'
THEN
set @emailSub = "Text for AB " + "Text for BC" + "Text for CD"
ENDIF
]%%