All Forums Database
30 Sep 2014
Dynamic value for SAMPLE RANDOMIZED ALLOCATION

I'm trying to input a dynamic value for SAMPLE RANDOMIZED ALLOCATION as in the example below. This produces an error: expected something like an integer or a decimal number...
Is there any way to input a dynamic value in this case?

select
customer_id, region
from customer_table
sample randomized allocation 
when region = 'usa' then (
select amount_needed from master_targeting_campaign where country_code ='United States')
end)
with data primary index (customer_id);

 I have also tried the below example and received the same error:

select
customer_id,
region
from customer_table
sample randomized allocation 
when region = 'usa' then master_targeting.amount_needed
end)
with data primary index (customer_id);

 

frnewbrough 41 posts Joined 03/08
30 Sep 2014

I don't believe that is possible. I tried several options but no dice.

frnewbrough 41 posts Joined 03/08
30 Sep 2014

You should look at this ->
http://forums.teradata.com/forum/database/getting-a-dynamic-sample

You must sign in to leave a comment.