Forum Discussion

InsightSeeker's avatar
InsightSeeker
Helper III
2 years ago
Solved

Assistance Needed for Creating a New Column

Hello,   I need help to create a new column based on the following conditions:   - If the settle name is equal to "Card" or "OCCF", and - The code is equal to "000100160", and - The number leng...
  • rajendraongole1's avatar
    2 years ago

    Hi InsightSeeker -  Here's how you can create a calculated column based on the given conditions

    NewColumn =
    IF (
    OR (
    'YourTableName'[settle name] = "Card",
    'YourTableName'[settle name] = "OCCF"
    ) &&
    'YourTableName'[code] = "000100160" &&
    LEN('YourTableName'[number]) = 11 &&
    LEFT('YourTableName'[number], 4) = "4398" &&
    RIGHT('YourTableName'[number], 4) = "1614" &&
    NOT ISBLANK('YourTableName'[code]),
    "valid",
    "error"
    )

    you can replace 'YourTableName' with the actual name of your table, and 'settle name', 'code', and 'number' with the actual column names in your dataset.

     

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