3 Replies Latest reply on Dec 31, 2018 3:24 AM by Ombir Rathee

    Writing clean "if not" formulas

    Alex Martino

      Hello. Is there a simpler way of writing this? Also, I tried using"or" instead of "and" and it didn't produce the right result. I'm trying to exclude amount when subhead equals any of those values, so not sure why "or" doesn't work.

       

       

      if [Sub-heads] <> "Null" AND [Sub-heads] <> "CASH FROM INVESTOR" AND [Sub-heads] <> "Inspection and quality control Expenses"

      AND [Sub-heads] <> "LOAN PAYMENT" AND [Sub-heads] <> "Product Prep" AND [Sub-heads] <> "Production Shipping" AND [Sub-heads] <> "Production Management"

      AND [Sub-heads] <> "Product Shipping" then [Amount]

      END

        • 1. Re: Writing clean "if not" formulas
          Norbert Maijoor

          Hi Alex,

           

          You posted the same question here;) if includ

           

          Regards

          Norbert

          • 2. Re: Writing clean "if not" formulas
            Mahfooj Khan

            Hi,

             

            I'd also suggest to create a set as Norbert Sir has mentioned in original post to filter out these sub-heads from your view .

             

            However, Use ISNULL() for your first condition and check.

             

            IF NOT  ISNULL([Sub-heads]) AND [Sub-heads] <> "CASH FROM INVESTOR" AND [Sub-heads] <> "Inspection and quality control Expenses"

            AND [Sub-heads] <> "LOAN PAYMENT" AND [Sub-heads] <> "Product Prep" AND [Sub-heads] <> "Production Shipping" AND [Sub-heads] <> "Production Management"

            AND [Sub-heads] <> "Product Shipping" then [Amount]

            END

             

            Let us know if this help.

             

            Mahfooj

            • 3. Re: Writing clean "if not" formulas
              Ombir Rathee

              Try this:

               

              IF NOT

                  (

                      [Sub-heads] = "Null" OR [Sub-heads] = "CASH FROM INVESTOR" OR [Sub-heads] = "Inspection and quality control Expenses"

                      OR [Sub-heads] = "LOAN PAYMENT" OR [Sub-heads] = "Product Prep" OR [Sub-heads] = "Production Shipping"

                      OR [Sub-heads] = "Production Management" OR [Sub-heads] = "Product Shipping" OR ISNULL([Sub-heads])

                  ) THEN [AMOUNT]

              END