New answers tagged

0 votes

Export results from Query Studio in excel file or SFTP

In the results, there should be a "Export in Contact Builder" option on top of the columns that will link you to the temporary data extension, from which you can export.
substate's user avatar
  • 101
0 votes

Query Returning Duplicates

De-dup the query using ROW_NUMBER() OVER (PARTITION BY s.SubscriberKey ORDER BY s.EventDate desc) as rn
vis_1019's user avatar
0 votes

validate cloudpage data

I would suggest you create an additional handler page (also a Cloudpage) to check and progress data. In the main Cloudpage: put handler page URL in the "form action" with the POST method so ...
Duc Le's user avatar
  • 2,244
0 votes

How to get specific number of email send within a time

The logic was correct, you had only the wrong Source DE for the grouping. Since you want to find subscribers who received at least 13 emails then we need to group not _Subscribers Data View but _Sent ...
Niko's user avatar
  • 2,585
0 votes

case : check if field A exist in field B

You do not need to overcomplicate it with a subquery in the CASE-WHEN statement, it is enough to simply compare two fields like that - SELECT Id, Email_source1, Email_source2, CASE WHEN ...
Niko's user avatar
  • 2,585
1 vote

Hi, does anyone know where is the error of this query?

The respective field for JBActivityID in _SMSMessageTracking is ActivityID in _JourneyActivity not JourneyActivityObjectID So it should be like this: SELECT smt.SubscriberKey, smt.CreateDateTime AS ...
Duc Le's user avatar
  • 2,244
1 vote

Any suggestions on better or optimized approach that returns single row from multiple rows based on ROW_NUMBER in SFMC

Since the relevant data is already available in the inner select, the join is unnecessary. Regarding performance, the camps are rather split between join vs sub-queries, until there is data to prove ...
Alex's user avatar
  • 86
2 votes
Accepted

Dynamic SQL Top() clause in SFMC

Nice solution by Adam. a different alternative I sometimes use is to store the "TOP" number in a control table with key/value pairs, and look it up based on some condition (e.g. id could be ...
Jonas Lamberty's user avatar
3 votes

Dynamic SQL Top() clause in SFMC

You could do use the row_number() window function to assign a sequential number to each row (in random order) and then only select rows that less than or equal to your volume value. Something like ...
Adam Spriggs's user avatar
0 votes

Recommended approach for coupon assignment in SFMC?

I had this same issue with ClaimRow(), and the recommendation from experienced specialists was to not use it. The recommended approach was to use the tried-and-true SQL JOIN merge between the ...
RyanLock's user avatar
1 vote
Accepted

Combining 3 SQL Queries into a Single Query

I'd suggest that you build a simple model outside of Marketing Cloud first -- instead of trying match counts. It's easier to look at the data and determine the desired outcomes before writing the ...
Adam Spriggs's user avatar

Top 50 recent answers are included