Compare the month of a date using the If function

I’m trying something very simple and I don’t know why it doesn’t work.
I store in the variable mes_hoy the month of the current date. In this case, the result is 4.


In the next module with variables, I want to assign certain values depending on whether the month is January or April, and I do this with the If function. If the month = 1, I will put a value here (for example, I have put it is 1). And if it is different, I will put another value (for example, I have put it is another).

When I run the scenario, although the value of the mes_hoy variable is equal to 4, the result of the if gives me as true the value of the expression mes_hoy = 1.

I don’t understand the reason and I have tried with quotes, without quotes, turning everything into text, into number, but it does not evaluate the condition of the if correctly.

Does anyone know what I might be doing wrong?

Thanks!

Hey @Enrique1 ,

You should use the equal operator of make instead of typing it via your keyboard.
please refer to below image

3 Likes

Oh my God!! Indeed, that was it. Thank you very much! It’s not the first time this has happened to me; I’m not used to selecting the symbols instead of typing them.

3 Likes

You can also type it this way

{{=}}

3 Likes