Please enable JavaScript to view this site.

 

Navigation: Tokens > Conditional Tokens

DayValues inside the Conditions of Zap or Conditional Tokens

Scroll Prev Up Next More

Usually, the conditions, inside a zap token or a conditional token, do not contain any DayValue.

 

Some typical examples would be:

 

[1zd<15] and [1?d<15|ZAP|]

 

But, in some cases, you might need to compare the values of tokens on different dates.

 

For example, in a checkerboard monthly grid, you might want to zap outside days using a token which compares the month of the current day, to the month of day 8:

 

[1zm~_8m_]

 

The meaning of a DayValue placed on the right of a condition is as follows:

 

default

(no DayValue)

The default case is when there are no DayValues anywhere in the zap or conditional token, after the characters "z" and "?", respectively.

 

In such cases, the tokens on the right side of the condition are based on the date of the parent conditional token or a zap token.

 

An example would be the following zap token that is triggered if the value of the year on the date of the token, is the same as the year of the current script.

 

[8Zyyyy~_year_]

 

In this case, what is evaluated is the result of [8yyyy] and of [8year] as both tokens use the parent token DayValue.

absolute

The use of an absolute DayValue in conditions corresponds to having a DayValue inside the tokens on the right side of the condition, as in the example below.

 

[3zm~_8m_]

 

In this case, what is evaluated is the result of [3m] and of [8m] as the left token uses the parent token DayValue, by default, but the right token uses the absolute DayValue of 8.

relative

The use of an relative DayValue in conditions corresponds to having a DayValue inside the tokens on the right side of the condition, preceded by a plus or minus sign, as in the examples below:

 

[5zm~_+1m_] and  [5zm~_-1m_]

 

The above examples check if the month of the following day, or previous day, respectively, belongs to the same month.

0 (zero)

You can use 0 (zero) as the DayValue of a token in a grid which is part of a month fit insert, to check if a date in in the current month as part of a zap or conditional token.

 

Note that you can mix-and-match the use default, absolute, zero or relative DayValues inside the same Zap or Conditional token.

 

See also: using tokens on the right side of conditions.

 


Topic 182820, last updated on 01-Aug-2020