Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
anriretief
Contributor III
Contributor III

Error in expression ')' expected

I currently have a variable defined as follows:

mu_Witmielies:

(1*sum({<SEISOEN = {"$(=vMaxSeisoen)"},GRAAD ={'WM1'},[TIPE GRAAN] ={'WITMIELIES'}>}Netto)+
2*sum({<SEISOEN = {"$(=vMaxSeisoen)"},GRAAD ={'WM2'},[TIPE GRAAN] ={'WITMIELIES'}>}Netto)+
3*sum({<SEISOEN = {"$(=vMaxSeisoen)"},GRAAD ={'WM3'},[TIPE GRAAN] ={'WITMIELIES'}>}Netto)+
4*sum({<SEISOEN = {"$(=vMaxSeisoen)"},GRAAD ={'WOG1'},[TIPE GRAAN] ={'WITMIELIES'}>}Netto)+
5*sum({<SEISOEN = {"$(=vMaxSeisoen)"},GRAAD ={'WOG2'},[TIPE GRAAN] ={'WITMIELIES'}>}Netto)+
6*sum({<SEISOEN = {"$(=vMaxSeisoen)"},GRAAD ={'WOG3'},[TIPE GRAAN] ={'WITMIELIES'}>}Netto))/
sum({<SEISOEN = {"$(=vMaxSeisoen)"},[TIPE GRAAN] ={'WITMIELIES'}>}Netto)

When I show the variable in a textbox as $(mu_Witmielies) I obtain the correct value. 

Now I would like to use this variable in a nested if statement expression as follows:

=IF(sum({<SEISOEN={"$(=vMaxSeisoen)"},[TIPE GRAAN]={'WITMIELIES'}>}Netto)<>0,
        IF(0<$(mu_Witmielies)<=1,'WM1',
            IF(1<$(mu_Witmielies)<=2,'WM2',
                IF(2<$(mu_Witmielies)<=3,'WM3',
                   IF(3<$(mu_Witmielies)<=4,'WOG1',
                      IF(4<$(mu_Witmielies)<=5,'WOG2',
                         IF(5<$(mu_Witmielies)<=6,'WOG3'
                             )))))))

QlikView shows that the expression is OK.

But the expression gives the error: ')' expected.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Your If statement syntax would probably rather be like:

=IF(sum({<SEISOEN={"$(=vMaxSeisoen)"},[TIPE GRAAN]={'WITMIELIES'}>}Netto)<>0,
        IF(0<$(mu_Witmielies) and $(mu_Witmielies)<=1,'WM1',
            IF(1<$(mu_Witmielies) and $(mu_Witmielies)<=2,'WM2',
                IF(2<$(mu_Witmielies) and $(mu_Witmielies)<=3,'WM3',
                   IF(3<$(mu_Witmielies) and $(mu_Witmielies)<=4,'WOG1',
                      IF(4<$(mu_Witmielies) and $(mu_Witmielies)<=5,'WOG2',
                         IF(5<$(mu_Witmielies) and $(mu_Witmielies)<=6,'WOG3'
                             )))))))

 

View solution in original post

2 Replies
tresesco
MVP
MVP

Your If statement syntax would probably rather be like:

=IF(sum({<SEISOEN={"$(=vMaxSeisoen)"},[TIPE GRAAN]={'WITMIELIES'}>}Netto)<>0,
        IF(0<$(mu_Witmielies) and $(mu_Witmielies)<=1,'WM1',
            IF(1<$(mu_Witmielies) and $(mu_Witmielies)<=2,'WM2',
                IF(2<$(mu_Witmielies) and $(mu_Witmielies)<=3,'WM3',
                   IF(3<$(mu_Witmielies) and $(mu_Witmielies)<=4,'WOG1',
                      IF(4<$(mu_Witmielies) and $(mu_Witmielies)<=5,'WOG2',
                         IF(5<$(mu_Witmielies) and $(mu_Witmielies)<=6,'WOG3'
                             )))))))

 

anriretief
Contributor III
Contributor III
Author

Thank you!