Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I know when the record is the last in a group?
Message
From
20/12/2000 10:29:53
 
 
To
20/12/2000 10:11:23
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00454522
Message ID:
00455427
Views:
37
Ahh I see what has been confusing us now.

The easiest thing for you to do is delete all your totals and replace them with variables.

As you will see when you create the variables it is possible to have the variables as being summed just like when you created your totals.

When you create your variable it will ask you what value you want to store in the variable.

You can use the variables in your equations to do what you want.





>Hi,
> No, I don't have the hidden fields. I don't have field in the last column. The sub-total in the "Group by" is calculated from the value on the left on the same line. You can see it in my example. I think when I calculate sub-total in the Group by row, I used the data on each line of record so when I sum up the sub-total, it in fact sum up by using the data in each record.
> So, I want to know can I sum up the sub-total which is in Group by row without sum up each record?
> Or can I store each of the sub-total in a variable or array, then I sum up the variable or array at the end of the report so to get the Total?
> Thanks for helping me again.
>


>>>
>>>$ received in   $ received in           Commision                  Commision
>>>last month      this month            in last month               in this month
>>>********************************* Nov ******************************************
>>>10000                 0
>>>    0                 4500
>>>10000             10000
>>> -----------------------------------------------------------------------------------------------------
>>>20000             14500                     4000                              2900 <------ Total of a month, Group by month
>>>
>>>******************************** Dec ******************************************
>>>20000             10000
>>>    0                    0
>>>10000             10000
>>> -----------------------------------------------------------------------------------------------------
>>>30000             20000                     6000                              4000 <------ Total of a month, Group by month
>>> ----------------------------------------------------------------------------------------------------
>>> Total of Commision in this month:                                       9800 <------ Total should be 2900 + 4000 = 6900 in this example.
>>>
>>>
>>>The formula to calculate the commision in this month is :
>>>Total $ reveived = total $ received in last month + total $ received in this month
>>> if the total $ received < 50000, the commision rate is 0.2
>>> if the total $ received > 50000 and < 100000, the first portion of commision is 50000 x 0.2 = 10000, the second portion of commision will be x 0.25.
>>> if the total $ received > 100000 and < 200000, .........., etc.
>>>So the commision of this month = total commision - commision already got in last month.
>>>For example, commision due to Nov = (20000 + 14500)*0.2 - 4000 = 2900
>>>commision due to Dec = (30000 + 20000)*0.2 - 60000 = 4000
>>>So the total commision in this month = 2900 + 4000 = 6900 which is the final result I want to have in my report.
>>>Hope it is much clearer. Thanks for help. I have been studying this problem for more than a week, my mind cannot run now.
Previous
Reply
Map
View

Click here to load this message in the networking platform