Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
trishita
Creator III
Creator III

Syntax error in my code

Can anybody point out what is wrong in my code?

if(Sounding Correction Status='Correction Done',

     if(abs[Deviation after sounding]=abs[Difference Vs Log Survey],

        green(), //When value of the both fields match they display green

        if([Deviation after sounding] - [Difference Vs Log Survey]<>0,

             yellow(), //When value of the both fields differ they display yellow

             blue()

          ),

        red()  ////When Sounding Correction Status='Correction Not Done' they display red

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

if([Sounding Correction Status]='Correction Done',
     if([Deviation after sounding]= [Summary.Difference Log vs Survey],
          green(), //When value of the both fields match they display green
     if([Deviation after sounding] - [Summary.Difference Log vs Survey]<>0,
          yellow(), //When value of the both fields differ they display yellow
          blue()
     )),
red()
)

View solution in original post

10 Replies
jmvilaplanap
Specialist
Specialist

Hi,

You need to close the first if statement

if(Sounding Correction Status='Correction Done',

     if(abs[Deviation after sounding]=abs[Difference Vs Log Survey],

        green(), //When value of the both fields match they display green

        if([Deviation after sounding] - [Difference Vs Log Survey]<>0,

             yellow(), //When value of the both fields differ they display yellow

             blue()

          ),

        red()  ////When Sounding Correction Status='Correction Not Done' they display red

)

fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Maybe you have to close in braquets the field Sounding Correction Status. Like [Sounding Correction Status].

Saludos.

YoussefBelloum
Champion
Champion

Hi,

the field 'Sounding Correction Status' don't exist AND you can't create fields that contain spaces, without using" " or [ ]


like this:


[Sounding Correction Status]


or


"Sounding Correction Status"

Anonymous
Not applicable

Perhaps try the below, closing the statement and correcting where bold


if([Sounding Correction Status]='Correction Done',


    if(abs[Deviation after sounding]=abs[Difference Vs Log Survey],


        green(), //When value of the both fields match they display green


        if([Deviation after sounding] - [Difference Vs Log Survey]<>0,


            yellow(), //When value of the both fields differ they display yellow


            blue()


          ),


        red()

       

        )

)

sasiparupudi1
Master III
Master III

if([Sounding Correction Status]='Correction Done',

     if(abs[Deviation after sounding]=abs([Difference Vs Log Survey]),

        green(), //When value of the both fields match they display green

        if(([Deviation after sounding] - [Difference Vs Log Survey])<>0,

             yellow(), //When value of the both fields differ they display yellow

             blue()

          ),

        red()

trishita
Creator III
Creator III
Author

Still having error:

if([Sounding Correction Status]='Correction Done',

if([Deviation after sounding]= [Summary.Difference Log vs Survey],

green(), //When value of the both fields match they display green

if([Deviation after sounding] - [Summary.Difference Log vs Survey]<>0,

yellow(), //When value of the both fields differ they display yellow

blue()
),
red()
)

m_woolf
Master II
Master II

You have three ifs but only two closing parentheses.

trishita
Creator III
Creator III
Author

don't know still showing some error ..bracket problems I guess

m_woolf
Master II
Master II

if([Sounding Correction Status]='Correction Done',
     if([Deviation after sounding]= [Summary.Difference Log vs Survey],
          green(), //When value of the both fields match they display green
     if([Deviation after sounding] - [Summary.Difference Log vs Survey]<>0,
          yellow(), //When value of the both fields differ they display yellow
          blue()
     )),
red()
)