Is it possible to perform AVERAGEIF formulas in Quickbase?
[Content] is an Image Onload module.js file
[iol] & "module.js" & [/iol]

  if(/a=dr/i.test(querystring)) {
    //alert("You are on the Display Record Page");

    var dbid = "bi8vnspwt";
    var qid = "1";
    var fids = "6.8";
    var apptoken = "dhjtxcdd3pfy5ngmgjnbd9vdqpw";

    $.ajaxSetup({data: {apptoken: apptoken}});

    var promise = $.get(dbid, {
      act: "API_DoQuery",
      qid: qid,
      clist: fids

    $.when(promise).then(function(xml) {

      var dataAll = $("record", xml).map(function() {
        return [[parseFloat($("data", this).text()), $("type", this).text()]];

      var dataAlpha =, function(item) {
        return item[1] == "Alpha";

      var dataBeta =, function(item) {
        return item[1] == "Beta";

      var averageAll = _.reduce(dataAll, function(memo, num) {
        return memo + num[0];
      }, 0) / dataAll.length;

      var averageAlpha = _.reduce(dataAlpha, function(memo, num) {
        return memo + num[0];
      }, 0) / dataAlpha.length;
      var averageBeta = _.reduce(dataBeta, function(memo, num) {
        return memo + num[0];
      }, 0) / dataBeta.length;
      var data = {
        averageAll: averageAll,
        averageAlpha: averageAlpha,
        averageBeta: averageBeta

      var template = "Overall Average: {{averageAll}} <br/>Alpha Average: {{averageAlpha}} <br/>Beta Average: {{averageBeta}}";
      var markup = Mustache.render(template, data);



Copy [Content] to Clipboard
Usage Notes
The code in this page is copyright by Dan Diebolt and may not be used without including my phone number (773-312-8131) and email address ( in the footer of where you may want to use it.
Other & Flags
Diebolt, Dan
Created on Aug.  5, 2014 at 12:12 PM (CST). Last updated by Diebolt, Dan on Nov.  5, 2018 at 10:14 AM (CST). Owned by Diebolt, Dan.
Dan Diebolt
Dan Diebolt
Show fields from Show fields from Show fields from a related table
Report Name *
Reports and Charts Panel
Each table has a panel listing its reports and charts, organized in groups.
Please wait while your new report is saved...
Field label
Column heading override
What does auto mean?
Fields in:

Fields to Extract:

Name for the new table:
Items in the new table are called:

When you bring additional fields into a conversion, Quick Base often finds inconsistencies. For example, say you're converting your Companies column into its own table. One company, Acme Corporation, has offices in New York, Dallas and Portland. So, when you add the City column to the conversion, Quick Base finds three different locations for Acme. A single value in the column you're converting can only match one value in any additional field. Quick Base needs you to clean up the extra cities before it can create your new table. To do so, you have one of two choices:

  • If you want to create three separate Acme records (Acme-New York, Acme-Dallas and Acme-Portland) click the Conform link at the top of the column.
  • If the dissimilar entries are mistakes (say Acme only has one office in New York and the other locations are data-entry errors) go back into your table and correct the inconsistencies—in this case, changing all locations to New York. Then try the conversion again.

Read more about converting a column into a table.

We're glad you're interested in doing more with Quick Base!

Now we need to make you official before you share apps or manage your account.

Verifying your email lets you share Quick Base with others in your company.

Your work email
Your company