3

We use data extensions for our A/b testing and some are fairly custom list setups for the A/b's. So long story short I would like to be able to use SQL percentages to setup my A/B extensions but based on percentages so that it will be fluid as the mast list total changes.

I know you could do in SQL like (first 50%)

WITH CTE
     AS (SELECT SubscriberID
                ROW_NUMBER() OVER ( ORDER BY SubscriberID) AS RN,
                COUNT(*) OVER()                   AS Cnt
         FROM   MasterSubscriberDE)
SELECT SubscriberID
FROM   CTE
WHERE  RN BETWEEN 0.0 * Cnt AND 0.5 * Cnt

Is there a way of achieving something similar to this with exactarget queries?

Currently I use static row ranges so would be nice if I could change to be more fluid (so I don't have to manually update).

SELECT SubscriberID
FROM (
    SELECT SubscriberID, ROW_NUMBER() OVER (ORDER BY SubscriberID) AS RowNum
    FROM MasterSubscriberDE
) AS RowRange
WHERE RowRange.RowNum BETWEEN 1 AND 25000
1
  • What would be even better (but I don't think it is possible) is if there is one DE with the list and then I can just use a filter to send against the DE based on percentage count. That way I would never even need to refill the sub DE's. But I do not think that is possible.
    – james
    Jun 25, 2014 at 15:05

1 Answer 1

1

You could do something like this if you want to retrieve a set percentage....

SELECT TOP 50 Percent SubscriberID  
FROM (
    SELECT SubscriberID, ROW_NUMBER() OVER (ORDER BY SubscriberID)
AS RowNum  
    FROM MasterSubscriberDE
) AS RowRange

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .