Data Access - Median

Data Access - Median

This guide will help you with the following:
  1. Overview
  2. Return
  3. Syntax
  4. Things to keep in mind
  5. Example

Overview

The median function in the "aggregate records" deluge task fetches records based on a specified criteria and sorts them in ascending order based on a specified field, and then returns the specified field's value from the median(lying in the middle) record if the number of records is even, or returns the average of the specified field's values from the median two records if the number of the records is odd.

The criteria is mandatory.

This function can be applied to the following field types:
  1. Number
  2. Percent
  3. Currency
  4. Decimal
  5. Formula (numeric)

Return

Based on the specified field, the data-type of the returned value could be one of the following:
  1. If the specified field type is Number, or Formula(bigint) the data type of the return value will be Number.
  2. If the specified field type is Percent, Currency, Decimal, or Formula(decimal), the data type of the return value will be Decimal.

Syntax

  1. <variable> = <form_link_name>[<criteria>].median(<field_link_name>);

Things to keep in mind

If you wish to fetch all records of the specified form, use the following script as criteria:
  1. [ID != 0]
It is advisable to fetch all records only when absolutely needed. Fetching all records generates a load resulting in performance issues.
This task can be used in the following events

Example

The following script returns the value of "age" field in the median record from the Employees form.
  1. EmployeeDetails = Employees [ ID != 0 ].median(age);

    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION








                                You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                    Manage your brands on social media

                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day


                                        Zoho Marketing Automation

                                          Zoho Sheet Resources

                                           

                                              Zoho Forms Resources


                                                Secure your business
                                                communication with Zoho Mail


                                                Mail on the move with
                                                Zoho Mail mobile application

                                                  Stay on top of your schedule
                                                  at all times


                                                  Carry your calendar with you
                                                  Anytime, anywhere




                                                        Zoho Sign Resources

                                                          Sign, Paperless!

                                                          Sign and send business documents on the go!

                                                          Get Started Now




                                                                  Zoho TeamInbox Resources



                                                                          Zoho DataPrep Resources



                                                                            Zoho DataPrep Demo

                                                                            Get a personalized demo or POC

                                                                            REGISTER NOW


                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now







                                                                                            You are currently viewing the help articles of Sprints 1.0. If you are a user of 2.0, please refer here.

                                                                                            You are currently viewing the help articles of Sprints 2.0. If you are a user of 1.0, please refer here.



                                                                                                  • Related Articles

                                                                                                  • Data Access - Collection variable

                                                                                                    This guide will help you with the following: Overview Declaring a collection variable Aggregate functions Fetch field value from the first record Fetch values of a field from all the records in a collection Updating field value in a collection ...
                                                                                                  • Data Access - Maximum

                                                                                                    This guide will help you with the following: Overview Return Syntax Things to keep in mind Examples Overview The maximum function in the "aggregate records" deluge task returns the largest value of a specified field from records fetched based on ...
                                                                                                  • Data Access - Minimum

                                                                                                    This guide will help with you the following: Overview Return Syntax Things to keep in mind Example Overview The minimum function in the "aggregate records" deluge task returns the smallest value of a specified field from records fetched using a ...
                                                                                                  • Data Access - Add Records

                                                                                                    This guide will help you with the following: Overview Return Syntax Things to keep in mind Applicable data-type and expression for each field Example Overview The add record deluge task creates a new record with given values in the specified form. ...
                                                                                                  • Data Access - Update records

                                                                                                    This guide will help you with the following: Overview Syntax Applicable data-type and expression for each field Things to keep in mind Example Overview The update records deluge task updates(replaces) the value of a specified field with the given ...
                                                                                                    Wherever you are is as good as
                                                                                                    your workplace

                                                                                                      Resources

                                                                                                      Videos

                                                                                                      Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                      eBooks

                                                                                                      Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                      Webinars

                                                                                                      Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                      CRM Tips

                                                                                                      Make the most of Zoho CRM with these useful tips.



                                                                                                        Zoho Show Resources