How is the raw data entered? Day? Week? or Month?
Tnx for the prompt reply. The data is not entered in date format but in PPM (parts per million) per cubic meter, which are all straight number and calculation fields and then re-calculated into metric liters per week and, as I have said, from there into monthly consumption and price. In the attachment .jpg you see the weekly calculation. What I intent to do is to attach a button with connected script in order to automatically calculate the monthly consumption. No problem so far, but I would like to have another script which simply reverts the monthly figures back into weekly figures.
Tnx for your help.
So the basic input is a "WEEK" of data. How is this week separate from last week or next week. What is the identifier to aggregate to a month.
Are you actually CHANGING the input data from week to month and now want to go back?
The basic calculation is a "WEEK" of data, as the amount of Chemicals are calculated on the base of the QM3 (Pool Size) Field which agregates PPM which in course agregates liters and price. The only fixed numbers here are the price per liter. Meaning, depending on pool size every client has a different amount of chemicals and consquently price.
Partly it depends on where and how you want to display the results. You could use a Global Variable to store the result of the calculations.
SetVariable [$$MonthlyMerusil; Value:YourField* 4]
Then display the variable <<$$MonthlyMerusil>> or the field value when the button is clicked.
Or, add a calculation field that automatically calculates the monthly value. Use the button to change a variable EX: $$Toggle, then use the variable in the "Hide object when" under the Behavior section of the Inspector. Hide when: $$Toggle = 1.
Button script would look like something like this:
If[$$Toggle = 0]
Set Variable [$$Toggle; Value: 1]
Set Variable [$$Toggle = 0]
Tnx a lot Byron. Works smooth as baby skin.
Cheers! Glad to help. Please mark as solved.