The function ecx:distribute generates a random result according to standard uniform distribution. The parameters define the ratio of probability that the result returns the value true. The value returned is a Boolean data type.

Structure​

ecx:distribute(integer, integer)

Parameters​

Parameter

Description

integer

Specifies a percentage of the total distribution.

integer

Specifies the total number considered for the distribution.

Example

A message contains a personalised message which includes a special offer. The offer is only visible to a percentage of randomly selected recipients.

The expression that inserts the personalisation into a message is constructed as follows:

<%InsertIf expression="${ecx:distribute(1,5)}" id="name"%>Text1<%/InsertIf%>

Hint:

The ID assigned to the personalisation in the expression is limited to 35 characters.


In this example, there is a 20% (1 in 5) chance that the personalisation is displayed in the message.

The ID assigned to the personalisation identifies the variation in the statistics and helps measure the performance of messages sent with the personalised message part