Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
How Do i use use variable's value for set analysis calculation in month & Year.
Variable is BSC
BSC =
sum((if(bil_bil_unit='2',(loa_rate*loa_act_wt)*1000,
//if(bil_bil_unit='3'or bil_bil_unit='2',((loa_rate*loa_act_wt)*1000),
if(bil_bil_unit='3' and loa_rate>10 and loa_rate<100,(loa_rate*loa_act_wt)*1000,
if(bil_bil_unit='3' or bil_bil_unit='5',(loa_rate*loa_act_wt),
if(bil_bil_unit='8' or bil_bil_unit='9' /*or bil_bil_unit='10'*/ or bil_bil_unit='13' or bil_bil_unit='21',(loa_rate*loa_dlv_qty),
//if(bil_bil_unit='10' or itemproduct='9940208',((loa_rate*loa_act_wt)*1000),
if(bil_bil_unit='27' and loa_dlv_qty>0,(loa_rate*loa_dlv_qty),
if(bil_bil_unit='27' or bil_bil_unit='34' and loa_cal_wt>0,(loa_rate*loa_cal_wt),
if(bil_bil_unit='27' or bil_bil_unit='34' and loa_act_wt>0,(loa_rate*loa_act_wt))))))))))
+
(sum((if(bil_bil_unit='10',(loa_rate*loa_dlv_qty)))))
Tha above formula working for max Year but not for previous year....
Eg :
Current Year = Sum({$<year={$(=max(year))}>}BSC) // its working
Prev Year = =Sum({$<year={$(=max(year)-1)}>}BSC) // giving wrong calculation, its showing me current year calculation.
Can any one help me.
Regards,
Antony.
try this
sum({$<year={$(=max(year))}>}
(if(bil_bil_unit='2',(loa_rate*loa_act_wt)*1000,
if(bil_bil_unit='3' and loa_rate>10 and loa_rate<100,(loa_rate*loa_act_wt)*1000,
if(bil_bil_unit='3' or bil_bil_unit='5',(loa_rate*loa_act_wt),
if(bil_bil_unit='8' or bil_bil_unit='9' or bil_bil_unit='13' or bil_bil_unit='21',(loa_rate*loa_dlv_qty),
if(bil_bil_unit='27' and loa_dlv_qty>0,(loa_rate*loa_dlv_qty),
if(bil_bil_unit='27' or bil_bil_unit='34' and loa_cal_wt>0,(loa_rate*loa_cal_wt),
if(bil_bil_unit='27' or bil_bil_unit='34' and loa_act_wt>0,(loa_rate*loa_act_wt))))))))))
+
(sum( {$<year={$(=max(year))}>} (if(bil_bil_unit='10',(loa_rate*loa_dlv_qty)))))
and for previous year
sum({$<year={$(=max(year)-1)}>}
(if(bil_bil_unit='2',(loa_rate*loa_act_wt)*1000,
if(bil_bil_unit='3' and loa_rate>10 and loa_rate<100,(loa_rate*loa_act_wt)*1000,
if(bil_bil_unit='3' or bil_bil_unit='5',(loa_rate*loa_act_wt),
if(bil_bil_unit='8' or bil_bil_unit='9' or bil_bil_unit='13' or bil_bil_unit='21',(loa_rate*loa_dlv_qty),
if(bil_bil_unit='27' and loa_dlv_qty>0,(loa_rate*loa_dlv_qty),
if(bil_bil_unit='27' or bil_bil_unit='34' and loa_cal_wt>0,(loa_rate*loa_cal_wt),
if(bil_bil_unit='27' or bil_bil_unit='34' and loa_act_wt>0,(loa_rate*loa_act_wt))))))))))
+
(sum( {$<year={$(=max(year)-1)}>} (if(bil_bil_unit='10',(loa_rate*loa_dlv_qty)))))
Hi Antony,
Can ypu please attach a demo qvw application.
Regards,
Som
Hi Som,
Thanks for your reply.
I can not attach the application.
Without sum how do i calcuate the expression.
Regards,
Antony.
Can any one help me to sort out this issue.......
Hi.
put max(year)-1 into a variable and let us know the result. is it what you expect it to be?
i tried but its not working
Is max(year) working? You need to concentrate on that, this may be your problem. If year is not a number for QV, the results you get are wrong.
for qty im taking the same year field only...
=sum({$<year={$(=max(year)-1)}>}Qty) - its working
= sum({$<year={$(=max(year)-1)}>}BSC) - its not working due to variable(BSC)
Hi,
Please By Pass the year vaue first and then write the expression.
ex
Sum({$<year = ,year={$(=max(year)-1)}>}BSC)
i hope this will help.
Hi Pratibha,
its not working....