Hi, I am having an issue with using variables.
I have a basic statement like this:
{IIF(column=='N',Variable=Variable+1,Variable+1)}
I feel this may be the incorrect way to use a variable because it seem the IF statement executes both sections if the statement is false.
For example, if column equals 'N', the result is a increasing variable by 1, But if "column" is not equal to 'N', the statement executes both sections of the IIF clause, first incrementing itself my one, and then adding 1 again for the displayed output.
I was hoping it would just skip over the first section, but it seem to execute both parts of IIF statement no matter what.
Variables in {IIF(,,)} Statments.
-
- Posts: 6458
- Joined: Tue Mar 20, 2018 5:34 am
Re: Variables in {IIF(,,)} Statments.
Hello,
Yes, IIF() function in any case, execute both statements.
In your case, you can use the following expression:
{(column == 'N' ? Variable=Variable+1 : Variable+1)}
Thank you.
Yes, IIF() function in any case, execute both statements.
In your case, you can use the following expression:
{(column == 'N' ? Variable=Variable+1 : Variable+1)}
Thank you.
Re: Variables in {IIF(,,)} Statments.
<t>Thank you, that works.</t>
Re: Variables in {IIF(,,)} Statments.
Great!
Thank you for the info!
Thank you for the info!