Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
>no can do.
Actually you can do this naively. I really hate that word "natively" - it is so self-limiting.
[Name] - Text Field
[Amount] - Numeric Currency Field
[Percentage] - Formula Numeric Field = 100 * [Amount] / ToNumber([Total])
Total Recall
https://haversineconsulting.quickbase.com/db/bnhmr8df6?a=td
There is no image onload field being used in this application and again the table has precisely three fields: [Name], [Amount] and [Percentage].
So how did I do it? Well the obvious question is where the field [Total] coming from? Well the simple answer is that it is not a field - it is a user defined variable whose value is calculated (via script) and set just prior to the report being displayed.
If you move to the Tasks table you will see there is a button labeled Total.js:
Clicking this button will execute the script in the pastie below and result in (1) calculating a new total of the [Amount] field in all records, (2) place the value in the user defined variable [Total] and (3) redirect to the List All report:
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=640
Now this may seem like a very convoluted way of generating a simple total. Why not just create a dummy or faux table to be the parent of the table holding all the data?
There is a very meaningful answer to this obvious question and good reason pursue solutions like this.
When you run into a limitation on what QuickBase can do "natively" you can often achieve your overall goal by performing some type of pre-processing operation to modify the QuickBase environment by temporarily creating (a) a user defined variable or (b) a report or chart, or (c) a temporary table.
Viewed in this more expansive light, once the pre-processing operation is complete you can then use "native" techniques to achieve some spectacular tasks (that are otherwise impossible) such as:
Actually you can do this naively. I really hate that word "natively" - it is so self-limiting.
Expand your repertoire of skills, challenge your longstanding mindset and generally embiggen your world.Check out this application which introduces a new technique I call Total Recall where the table has exactly three fields:
[Name] - Text Field
[Amount] - Numeric Currency Field
[Percentage] - Formula Numeric Field = 100 * [Amount] / ToNumber([Total])
Total Recall
https://haversineconsulting.quickbase.com/db/bnhmr8df6?a=td
There is no image onload field being used in this application and again the table has precisely three fields: [Name], [Amount] and [Percentage].
So how did I do it? Well the obvious question is where the field [Total] coming from? Well the simple answer is that it is not a field - it is a user defined variable whose value is calculated (via script) and set just prior to the report being displayed.
If you move to the Tasks table you will see there is a button labeled Total.js:
Clicking this button will execute the script in the pastie below and result in (1) calculating a new total of the [Amount] field in all records, (2) place the value in the user defined variable [Total] and (3) redirect to the List All report:
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=640
Now this may seem like a very convoluted way of generating a simple total. Why not just create a dummy or faux table to be the parent of the table holding all the data?
There is a very meaningful answer to this obvious question and good reason pursue solutions like this.
When you run into a limitation on what QuickBase can do "natively" you can often achieve your overall goal by performing some type of pre-processing operation to modify the QuickBase environment by temporarily creating (a) a user defined variable or (b) a report or chart, or (c) a temporary table.
Viewed in this more expansive light, once the pre-processing operation is complete you can then use "native" techniques to achieve some spectacular tasks (that are otherwise impossible) such as:
- Create Custom Summary Reports
- Create Custom Email Notifications
- Create or Modify a QuickBase Generated Chart
AmmarAl-Hadeeth
8 years agoQrew Member
The "<img> onload" technique is used to calculate the total when you load the page without having to press a button.
If you have a report of 50 records that the total need to be calculated for each one of them and displayed in the same row, it wouldn't be feasible to click the button 50 times!
Regards
If you have a report of 50 records that the total need to be calculated for each one of them and displayed in the same row, it wouldn't be feasible to click the button 50 times!
Regards