how to set up system:month.number to look a prevoius month without it giving me 0 in the process
example: if the month is january 01 - 1 it will be 00 i wanted to be 12.
is there a way to make it -1 system:month?
$System:Month.Number:toString$-1
how to set up system:month.number to look a prevoius month without it giving me 0 in the process
example: if the month is january 01 - 1 it will be 00 i wanted to be 12.
is there a way to make it -1 system:month?
$System:Month.Number:toString$-1
Hi
In Automation Anywhere, the $System:Month.Number$ variable gives you the current month as a number (1 for January, 2 for February, and so on). If you want to get the previous month, you can subtract 1 from this value. However, as you've pointed out, this can cause an issue when the current month is January (1 - 1 = 0).
To handle this, you can use a conditional statement (If-Else) in your bot. Here's an example:
PreviousMonth
.PreviousMonth
.PreviousMonth
to 12 (for December).Here's how the pseudo-code would look:
If $System:Month.Number$ > 1 Then
Set `PreviousMonth` = $System:Month.Number$ - 1
Else
Set `PreviousMonth` = 12
End If
Now, you can use the PreviousMonth
variable in your bot to represent the previous month as a number. Please note that this is a workaround and the actual implementation might vary based on the exact requirements and the version of Automation Anywhere you're using.
For more information on using variables and conditional statements in Automation Anywhere, you can refer to the following documentation:
Hi
In Automation Anywhere, the $System:Month.Number$ variable gives you the current month as a number (1 for January, 2 for February, and so on). If you want to get the previous month, you can subtract 1 from this value. However, as you've pointed out, this can cause an issue when the current month is January (1 - 1 = 0).
To handle this, you can use a conditional statement (If-Else) in your bot. Here's an example:
PreviousMonth
.PreviousMonth
.PreviousMonth
to 12 (for December).Here's how the pseudo-code would look:
If $System:Month.Number$ > 1 Then
Set `PreviousMonth` = $System:Month.Number$ - 1
Else
Set `PreviousMonth` = 12
End If
Now, you can use the PreviousMonth
variable in your bot to represent the previous month as a number. Please note that this is a workaround and the actual implementation might vary based on the exact requirements and the version of Automation Anywhere you're using.
For more information on using variables and conditional statements in Automation Anywhere, you can refer to the following documentation:
will it work all inside a String assign ?
$vListIndicators1.LegacyAutomation:getLegacyIndexValue($Loop-Counter-1.LegacyAutomation:getDecrementedNumber$)$0$vPreviousMonth$
Hi
Rather then creating this logic why not you use following actions.
Now to get the final value in string
Use “To String” action from datetime package
Pass the source as the output of the above action
Select “Custom format” and type “MM” for month in numbers
Assign the string variable to the output.
That’s it. this will give you your desired output in two lines. Converting the Month into number will always give you the proper mathematical output.
Hope this helps.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.