내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards
해결됨

SQL query to read Array values of a Order Value column

Avatar

Level 3

Hi Team,  

In Data feed raw data, Order_value column has multiple values inside the Array.  Can you please help me with Query to sum up array. 

 

for instance:  

DineshRkumar_0-1730106506478.png

 

 

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor and Adobe Champion

There might be an easier way to do this, but it's been a while since I've had to do SQL regularly.

If you want to sum up the values in an array, you need to split out the values of that array, you can do that with the "SPLIT" function, which will put each value on it's own line using a delimiter. But you also have the brackets at the start/end of the array, so you need to get rid of those, I did that with the "REPLACE" function. Just replaced the bracket with an empty value.

 

split(replace(replace(rev_values, "[", ""), "]", ""), ",")

 

MandyGeorge_0-1730398285126.png

 

Once all of the values are on their own row, you can do your normal aggregations to sum.

 

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Community Advisor and Adobe Champion

There might be an easier way to do this, but it's been a while since I've had to do SQL regularly.

If you want to sum up the values in an array, you need to split out the values of that array, you can do that with the "SPLIT" function, which will put each value on it's own line using a delimiter. But you also have the brackets at the start/end of the array, so you need to get rid of those, I did that with the "REPLACE" function. Just replaced the bracket with an empty value.

 

split(replace(replace(rev_values, "[", ""), "]", ""), ",")

 

MandyGeorge_0-1730398285126.png

 

Once all of the values are on their own row, you can do your normal aggregations to sum.