Forum Discussion

Sidzx6r's avatar
Sidzx6r
Frequent Visitor
2 years ago
Solved

Conditional Nested IF Statement

Hello All   How do i write nested if statement column condition to replace blank values with "NoProgress" when schedule date is blank or null. Calendar date column from calendar auto table has all...
  • rajendraongole1's avatar
    2 years ago

    Hi Sidzx6r - Create a new column as below to check on scheduled date.

    Conditional =
    IF (
        ISBLANK(ScheduledT[Scheduled Date]),
        "NoProgress",
        IF (
            ScheduledT[Type] = "A" && ScheduledT[Product] <> "HOLIDAY",
            "InProgress",
            ""
        )
    )

     

     

    you can join the calendar and schedule tables based on date column 

     

    Create merged table reflects the correct structure and that the conditional column shows "NoProgress" for dates without scheduled entries. 

     

    Hope it works. 

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!

  • MNedix's avatar
    2 years ago

    Sidzx6r 
    Alternatively to rajendraongole1 's solution, you can use a Switch function as below; the advantage of the Switch function is lower complexity and highly increased scalability (multiple conditions with ease of configuraiton):

     

    New Conditional = 
    SWITCH(
        TRUE(),
        ISBLANK(Sheet1[Scheduled Date]),"InProgress",
        Sheet1[Scheduled Date]="null","InProgress",
        Sheet1[Conditional]
    )

     

    In your example, you don't really need the "null" statement but I put it there just in case you encounter it in your data model. You can use as many conditions as you need (including && operators, for example for the Type B Products).

     

    Best,

     

  • MNedix's avatar
    MNedix
    2 years ago

    Sidzx6r it would be great if you marked an answer as the solution to your problem so other users can see it.

     

    Best,