Need help with if statement

I have a column called ‘Paid’ which returns either 0 or 1

Within another column I want to say if 1 say thank you, else say not paid.

I have this:-

if ‘Paid’ == 1 then ‘thank you’ else ‘Not Paid’ end

but it is not working

Please help

Thanks

smith06,
You will need to use for you Message a Custom List field and use the option ‘Custom’.

Schema-
{
“id”: 98168,
“num_rows”: 1000,
“file_format”: “csv”,
“name”: “forum”,
“include_header”: true,
“columns”: [
{
“name”: “Paid”,
“null_percentage”: 0,
“type”: “Number”,
“min”: 0,
“max”: 1,
“decimals”: 0,
“formula”: “”
},
{
“name”: “Message”,
“null_percentage”: 0,
“type”: “Custom List”,
“values”: [
“Thank you”,
“Not Paid”
],
“selectionStyle”: “custom”,
“distribution”: [
{
“frequencies”: {
“Thank you”: 1,
“Not Paid”: “0”
},
“rule”: “field(“Paid”)==1”
},
{
“frequencies”: {
“Thank you”: “0”,
“Not Paid”: “1”
},
“rule”: “field(“Paid”)==0”
}
],
“formula”: “”
}
]
}

Hope this helps you.

Rich

The below should work:

Paid field (Formula)

random(0, 1)

Thank you field (Formula)

if field("paid") == 0 then 'Thank you' elsif field("paid") == 1 then 'Not Paid' end

Hi there.

I’m also having problems with the if statement. I have the following formula in a formula field: if field(“dod”)>field(“date_of_birth”) then ‘A’ else ‘B’

And can’t help the below error:
Syntax error in formula ‘if field(“dod”)>field(“date_of_birth”) then ‘A’ else ‘B’’

Could you please try to help me? I’ve tried the following, just o check, but did not work as well:

if 3>1 then 'A' else 'B'

Cheers,
Patricia

Hi @patriciainez - try adding end to the end of your statement:

if field("dod") > field("date_of_birth") then 'A' else 'B' end

Hi @mp_np. That worked! Thanks so much and sorry for the silly mistake :blush:

Any idea why this does not work ;-(

If boolean field “RewardMember” is false I need to have 0 in this number field.
Thanks

if field(“RewardMember”) == ‘false’ then ’ ’
else this
end