Notion Answers

Help between Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

2votes

Eisenhower if statement

Looking for a statement that nests these statements together. I have five "type" properties that correspond to the property " progress" so I need it to check which "type" it is (Type1, Type2, Type3, Type4, Type5) then based on which type it'll pull the corresponding " progress" property value and check how many days left.

< 14 means "Attention"
< 7 means "Urgent"
100% value means "Closed"
All above statements being false means "Active"

I have this so far, they work as separate statements but I need it to check for all three conditions before returning an answer:

if(prop("Type") == "Type1",
"Active",
if(dateBetween(prop("Deadline"), Now(), "days") < 14,
"Attention",
if(dateBetween(prop("Deadline"), Now(), "days") < 7,
"Urgent",
if(prop("Type1 Progress") == "✦✦✦✦✦✦✦✦✦✦ 100%",
"Closed"
)
)
)
)

^This is not functioning

1 Answer

1vote

Soteria Points230

I created my own answer. Below is the nested code to print out the urgency status based on the if values.

if(prop("Type") == "Type1",
    if(prop("Type1 Progress") == "✦✦✦✦✦✦✦✦✦✦ 100%",
        "Closed",
        if(dateBetween(prop("Deadline"), now(), "days") < 7,
            "Urgent",
                if(dateBetween(prop("Deadline"), now(), "days") < 14,
                    "Attention",
                    "Active"
                )
            )
    ),
    if(prop("Type") == "Type2",
        if(prop("Type2 Progress") == "✦✦✦✦✦✦✦✦✦✦ 100%",
            "Closed",
           if(dateBetween(prop("Deadline"), now(), "days") < 7,
                "Urgent",
                if(dateBetween(prop("Deadline"), now(), "days") < 14,
                    "Attention",
                    "Active"
                )
            )
        ),
        if(prop("Type") == "Type3",
            if(prop("Type3 Progress") == "✦✦✦✦✦✦✦✦✦✦ 100%",
                "Closed",
                if(dateBetween(prop("Deadline"), now(), "days") < 7,
                    "Urgent",
                    if(dateBetween(prop("Deadline"), now(), "days") < 14,
                        "Attention",
                        "Active"
                    )
                )
            ),
            if(prop("Type") == "Type4",
                if(prop("Type4 Progress") == "✦✦✦✦✦✦✦✦✦✦ 100%",
                    "Closed",
                    if(dateBetween(prop("Deadline"), now(), "days") < 7,
                        "Urgent",
                        if(dateBetween(prop("Deadline"), now(), "days") < 14,
                            "Attention",
                            "Active"
                        )
                    )
                ),
                if(prop("Type") == "Type5",
                    if(prop("Type5 Progress") == "✦✦✦✦✦✦✦✦✦✦ 100%",
                        "Closed",
                        if(dateBetween(prop("Deadline"), now(), "days") < 7,
                            "Urgent",
                            if(dateBetween(prop("Deadline"), now(), "days") < 14,
                                "Attention",
                                "Active"
                            )
                        )
                    ),
                    "N/A"
                )
            )
        )
    )
)

^Checks for all nested if statements from most restrictive to least restrictive to print out the corresponding urgency statement and if all are false then it will print "N/A"

0vote

polle commented

Thank you for sharing the solution!

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect