Frequently, in addition to a simple data output, it may be necessary to perform different kinds of data manipulation, such as summation, calculation of simple average, etc.
Let's discuss a few cases based on Cars template that comes with the software. Depending on complexity of solving problem you need to make some changes on Events screen, or on Edit SQL query screen
This approach works the best when you need to display the calculated value but you don't need to save it in the database.
1. Open your project and proceed to Edit SQL Query screen.
2. Switch to the SQL mode.
3. In SQL mode add string ([EPACity] + [EPAHighway])/2 as AvgEpa.
4. Proceed to Choose fields screen.
5. For AvgEpa field unselect following check boxes: Add, Edit, Inline Add, Inline Edit.
6. Build your project and view results in the web browser.
1. Click on Before Record Updated Event.
2. Modify sample event code by putting following code snippets to appropriate place.
3. Apply the same code to Before Record Added Event.
1. Open your project and proceed to the Events screen.
3. Add following code:
Now you can edit or add new records and every time when you make changes in Horsepower or Price field correspondingly Tax field has changed. It's very comfortable because right away you see imposed tax and can modify the price depending on it.