Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217117

Operators AND - OR in Nested IF

$
0
0

I am struggling with a silly formula but I am not able to find the proper solution. I know it should be easy .....

 

CS_Universe = 
IF (
    ZV[OrgCom] = "CUSTORG"&& ZV[IDCust] = "491"&& ( ZV[IDDel] = "SPD99"
        || ZV[IDDel] = "WAR99"
        || ZV[IDDel] = "DPD99"
        || ZV[IDDel] = "FOC99"
        || ZV[IDDel] = "KBD99" );
    "1CS";
    IF (
        ZV[OrgCom] = "CUSTORG"&& ZV[IDCust] = "491"&& (ZV[CounFinGood] = "MX"   
            || ZV[CounFinGood] = "RU"
            || ZV[CounFinGood] = "AR"
            || ZV[CounFinGood] = "CN")
            ;
        "2CS";
        IF (
            [OrgCom] = "CUSTORG"&& [IDCust] <> "491"&& [ECC] = "X"&& ( ZV[IDDel] = "SPD99"
                || ZV[IDDel] = "WAR99"
                || ZV[IDDel] = "DPD99"
                || ZV[IDDel] = "FOC9"
                || ZV[IDDel] = "KBD99" );
            "3CS";
            IF (
                [OrgCom] = "CUSTORG"&& [IDCust] <> "491"&& [ECC] = BLANK ()&& ( ZV[IDDel] = "SPD99"
                    || ZV[IDDel] = "WAR99"
                    || ZV[IDDel] = "DPD99"
                    || ZV[IDDel] = "FOC99"
                    || ZV[IDDel] = "KBD99" );
                "4CS";
                BLANK ()
            )
        )
    )
)

This formula work perfectly except the 2nd if that should write "2CS".  I also moved it bottom just to test.

 

Then I added a new calculated column putting only the following and I have got the right result.

IF (
        ZV[OrgCom] = "CUSTORG"&& ZV[IDCust] = "491"&& (ZV[CounFinGood] = "MX"   
            || ZV[CounFinGood] = "RU"
            || ZV[CounFinGood] = "AR"
            || ZV[CounFinGood] = "CN")
            ;
        "2CS";

 

So syntax is correct and the order of operators too, otherwise the first IF above should not work.

Please is there someone who could explain me how to fix it?

Thanks


Viewing all articles
Browse latest Browse all 217117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>