Campaign Module:


Campaigns can be utilized in the following fashion:

-              Make sure the product feed contains at least a start time and end time. The product feed can contain more than one set of times, but at least one set must exist for campaigns to function.


-              In the product import configuration, set up headers to represent the campaign start and campaign end times. Set header type to ScheduleStart/ScheduleEnd respectively. In the settings for each header, remember to set the date format used in the product feed. Currently there is the default XML format, or a custom format, following the standards found here: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings - optionally, a schedule name can be set as well (can refer to a field name by enclosing it in square brackets [] ).

Make sure to connect the two fields by common "campaign name" - if only one campaign it is possible to leave this out.


-              Set up any dynamic fields that may need to use the campaign system. This is done by using the schedule dynamic functions called InSchedule() or InSchedule(<Name>).


For example: IF(INSCHEDULE('Udsalg'),IF(INSCHEDULE('MixMatch'),'SALEMIXMATCH','SALE'),IF(INSCHEDULE('MixMatch'),'MIXMATCH','NORMAL'))


Another example:


If  MIXED_CAMPAIGN is active, select layout MIXED


If SALE_CAMPAIGN is active, select layout SALE


If none of the are active - select layout NORMAL


IF(INSCHEDULE('SALE_CAMPAIGN'),IF(INSCHEDULE('MIXED_CAMPAIGN'),'MIXEDSALE','SALE'),IF(INSCHEDULE('MIXED_CAMPAIGN'),'MIXED','NORMAL'))


Mathematical expressions (used in product import settings):

Introducing 4 new mathematical functions and three rounding functions. All of them must be supplied with a valid number.

A valid number here is considered as a number without group separator and dot (.) as decimal separator. Only one decimal separator is allowed. It is also possible to use - in front of the number to indicate a negative number.


So for example the following is considered valid:

-123

-123.45

123

123.45


While the following is considered invalid:

123,45                (Comma is used as decimal separator)

+123                   (Indication of a positive number with the plus-sign is not allowed)

1,234.56            (Group separator is not allowed)


To adapt the source data to a valid format for the math functions the following can be used:

DECIMAL([PRICE])                     //Convert the variable [PRICE] to decimal with . as decimal separator. DECIMAL will accept both , and . as decimal seperators.

REPLACE([PRICE],',','.')           //Replace comma with . in the variable [PRICE]


Mathmatical functions


ADD

ADD(number1, number2, .., numberN)

Will add all numbers in the function together.

Example: ADD([A],[B])


SUBTRACT

SUBTRACT(number1, number2, ..., numberN)

Will subtract all the numbers from each other

Example: SUBTRACT([D],[E])


MULTIPLY

MULTIPLY(Number1, number2, ..., numberN)

Will multiply all the numbers together.

Example: MULTIPLY([F],2)


DIVIDE

DIVIDE(number1, number2, ..., numberN)

Will divide all the numbers with each other.

Example: DIVIDE([G],[F])


ROUND

ROUND(number, NumberOfDecimals)

Will round to nearest number with the selected number of decimals. The returned value will always returned the number of decimals selected.

Example:

ROUND(123.45,0) //returns 123

ROUND(123.5,0) //returns 124

ROUND(123.55) //returns 124


ROUNDDOWN

ROUNDDOWN(number, NumberOfDecimals)

Will round down to nearest number with the selected number of decimals. The returned value will always returned the number of decimals selected.

Example:

ROUND(123.45,0) //returns 123

ROUND(123.5,0) //returns 123

ROUND(123.55) //returns 123


ROUNDUP

ROUNDUP(number, NumberOfDecimals)

Will round up to nearest number with the selected number of decimals. The returned value will always returned the number of decimals selected.

Example:

ROUND(123.45,0) //returns 124

ROUND(123.5,0) //returns 124

ROUND(123.55) //returns 124



Other examples:

Subtract 25% VAT and add 14% VAT and then returned the number with two decimals

ROUND(MULTIPLY([VARIABLE],0.8,1.14),2)


Subtract 25% VAT and return with 2 decimals:

ROUND(MULTIPLY([VARIABLE],0.8),2)


Get 75% of the number:

MULTIPLY(DIVIDE([VARIABLE],100),75)


Formatting examples:

Get the saving discount for two numbers formatted with comma (,) as decimal separator and output with comma and two decimals.

REPLACE(ROUND(SUBTRACT(DECIMAL([NORMALPRICE]),DECIMAL([DISCOUNTPRICE])),2),'.',',')


Furthermore the following functions has been introduced:

ISEMPTY

ISEMPTY(text)

Can only be used inside an IF statement

Example:

IF(ISEMPTY('[VARIABLE]'),'EMPTY','NOT EMPTY')


ISNOTEMPTY

ISNOTEMPTY(text)

Can only be used inside an IF statement

Example:

IF(ISNOTEMPTY('[VARIABLE]'),'NOT EMPTY','EMPTY')


VALUEIFEMPTY

VALUEIFEMPY(text, replacevalue)

Can be used anywhere, will check if the first parameter is empty and used the text in the second parameter, otherwise return the text unchanged

Example:

VALUEIFEMPTY('[VARIABLE]','OTHERVALUE')

This will be the same as the following formula: IF(EMPTY('[VARIABLE]'),'OTHERVALUE','[VARIABLE]')