Skip to main content
source formatting
Source Link
Adam Spriggs
  • 31.1k
  • 6
  • 44
  • 88

Counting the Values of the field in Amp ScriptAMPScript

I have a field called travelinterest andtravelinterestand data extension name called testforelavaran,testforelavaran. i dont know how many values in that field, suppose if that field contains four values,  (col1,col2,col3,col4) and i want to count the values using rowcount, by using for loop and i will concetenateconcatenate all the four values by using semicolon

I have tried:

I have tried:

%%[ 
var @travelinterest, @rows, @rowCount,@interestsTemp
set @rows = LookupRows("testforelavaran","travelinterest", @lookupValue)
set @rowCount = rowcount(@rows)
for @i = 1 to @rowCount
set @interestsTemp = concat(
    iif(empty(@travelinterest[i]),'',concat(@travelinterest[i],';'))
]%%

but it is not working, please help me with amp scriptAMPScript code,

My output will be - output value is %%(travelinterest)%% (col1;col2;col3;col4)

My output will be - output value is %%(travelinterest)%% (col1;col2;col3;col4)

Counting the Values of the field in Amp Script

I have a field called travelinterest and data extension name called testforelavaran, i dont know how many values in that field, suppose if that field contains four values,(col1,col2,col3,col4) and i want to count the values using rowcount, by using for loop and i will concetenate all the four values by using semicolon

I have tried:

%%[ 
var @travelinterest, @rows, @rowCount,@interestsTemp
set @rows = LookupRows("testforelavaran","travelinterest", @lookupValue)
set @rowCount = rowcount(@rows)
for @i = 1 to @rowCount
set @interestsTemp = concat(
    iif(empty(@travelinterest[i]),'',concat(@travelinterest[i],';'))
]%%

but it is not working, please help me with amp script code,

My output will be - output value is %%(travelinterest)%% (col1;col2;col3;col4)

Counting the Values of the field in AMPScript

I have a field called travelinterestand data extension name called testforelavaran. i dont know how many values in that field, suppose if that field contains four values,  (col1,col2,col3,col4) and i want to count the values using rowcount, by using for loop and i will concatenate all the four values by using semicolon

I have tried:

%%[ 
var @travelinterest, @rows, @rowCount,@interestsTemp
set @rows = LookupRows("testforelavaran","travelinterest", @lookupValue)
set @rowCount = rowcount(@rows)
for @i = 1 to @rowCount
set @interestsTemp = concat(
    iif(empty(@travelinterest[i]),'',concat(@travelinterest[i],';'))
]%%

but it is not working, please help me with AMPScript code,

My output will be - output value is %%(travelinterest)%% (col1;col2;col3;col4)

Source Link
user46593
user46593

Counting the Values of the field in Amp Script

I have a field called travelinterest and data extension name called testforelavaran, i dont know how many values in that field, suppose if that field contains four values,(col1,col2,col3,col4) and i want to count the values using rowcount, by using for loop and i will concetenate all the four values by using semicolon

I have tried:

%%[ 
var @travelinterest, @rows, @rowCount,@interestsTemp
set @rows = LookupRows("testforelavaran","travelinterest", @lookupValue)
set @rowCount = rowcount(@rows)
for @i = 1 to @rowCount
set @interestsTemp = concat(
    iif(empty(@travelinterest[i]),'',concat(@travelinterest[i],';'))
]%%

but it is not working, please help me with amp script code,

My output will be - output value is %%(travelinterest)%% (col1;col2;col3;col4)