Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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'
)))))))
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'
)))))))
Thank you!