if you're calculating for fields you're right.
but then it is still not working!
forgot to mention, this table is made of thousands of rows, where each one of them is an item.
For each item there are 12 buckets, i basically to have a further field being the weighted average described as above.
I needed to change a bit your script to have the colours appear in the script.
and so on...)
But I got the following error when reloading
Invalid expression BucketDemand: LOAD *, if (if(BUCKET>=-3 and BUCKET<=-1,sum(BucketQty)/3) > if(BUCKET>=-6 and BUCKET<=-4,sum(BucketQty)/3) * 1.01, if(BUCKET>=-3 and BUCKET<=-1,sum(BucketQty)/3), if(BUCKET>=-6 and BUCKET<=-1,sum(BucketQty)/6)) as CalcTrend RESIDENT BucketDemandTemp
so still not good....
I think the problem now is not the IF command but using the Sum function you have to use the group by.
I attach a simple example to understand:
Sum(FieldB) as SumFieldB,
[C:\Documents and Settings\test\Desktop\Sum.xlsx]
(ooxml, embedded labels, table is test)
group by Id,FieldA,FieldC;
group by is obligatory.
I suppose that adding group by in your table you could solve your problem.
Hope it helps