on 04-22-2010 3:48 PM
Hello all,
how can I calculate a product of two key datas line by line? The default is column by column but in this case I get a incorrect result.
Here is an example what I mean:
Table 1:
Month.........Type...... Distance(km)......Weight(kg).........Distance * Weight
Jan.............Typ_1.............2..........................10...........................20
Jan.............Typ_2.............5..........................20.........................100
Jan.............Typ_3.............4..........................10...........................40
Sum............................................................................................160 <-- correct Sum
When I list the key datas only for month I get a different sum(see Table 2)
How can I get the information in Table 2 with the correct sum of Table 1 ?
Can you help me to fix the problem ?
Table 2:
Month.......Distance (km)....... Weight (kg).................. Distance * Weight
Jan...................11...........................40...............................440 <-- incorrect Sum
Hi,
You have to make use of calculation context functions like 'ForEach' and 'ForAll' to calculate the sum here.
In the second table, you don't have a product dimension, but you want to calculate it by product dimension. So use ForEach function to include the product dimension in the calculation. Create a new variable and use this function to calculate the sum. If you need more details BO help is one good place where you can find information on these calculation contexts or just google up :).
Please let me know if you need anymore information.
Regards,
Sanjay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.