Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Master II
Master II

Re: Syntax error in my code

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
Highlighted
Specialist
Specialist

Re: Syntax error in my code

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

)

Highlighted
Partner
Partner

Re: Syntax error in my code

Hi,

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

Saludos.

Highlighted
Champion
Champion

Re: Syntax error in my code

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"

Highlighted
Contributor II
Contributor II

Re: Syntax error in my code

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()

       

        )

)

Highlighted
Master III
Master III

Re: Syntax error 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()

Highlighted
Creator III
Creator III

Re: Syntax error in my code

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()
)

Highlighted
Master II
Master II

Re: Syntax error in my code

You have three ifs but only two closing parentheses.

Highlighted
Creator III
Creator III

Re: Syntax error in my code

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

Highlighted
Master II
Master II

Re: Syntax error in my code

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