Skip to Content

if then else error

Hi,

I've the following columns:

C1 and C2

C1 has an integer and C2 indicates whether C1 (in the origin) has null/empty/space value or has an integer value (including 0).

In case C2 would be 1 it means C1 has null/empty/space and in case C2 would be 0 it means C1 has an integer value (including 0).

IF ( C2 = 1) THEN 'ERROR' ELSE C1

in query designer I've tried the following, but I get an error:

( C2 == 1 ) * C1 / C1 + ( C2 == 0 ) * C1

- ( C2 == 1 ) * C1 / C1

it means that if C1 is a SPACE I provoke error (C1 / C1) in the query. In AO I want to get X.

Can anybody tell how to do this formula?

( C2 == 1 ) * C1 / C1 + ( C2 == 0 ) * C1


Thanks in advance.

Regards.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 13, 2016 at 03:04 PM

    Hi,

    You may do this..

    (C2 == 1) * 1/0 + C1

    If it didn't work, try add first the 1/0 in a formula, let's call it C3..

    C3 = 1/0

    Then your IF condition would be..

    (C2 == 1) * C3 + C1

    Regards,

    Loed

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.