--- title: "RAND(A)" slug: "dmathfunction-19" updated: 2021-11-03T13:13:15Z published: 2021-11-03T13:13:15Z canonical: "docs.datajet.app/dmathfunction-19" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # RAND(A) ## DMath: RAND(A) ## Creates a random and equal distribution of values between 0 and A ## Purpose Use this function to: - Create evenly distributed Random data ## Return Value | Property | Value | | --- | --- | | **FieldType** | Double | | **FieldSize** | Low / Med / High / Continuous | | **DataType** | Discrete / Continuous | | **DataSize** | Short / Integer / LongInteger / Double | ```shell Example Return Value: X*.XXXXXX....-X*.XXXXX e.g. 21.000000, 98754654.123456, -5.000000, -654.320000 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DMATH_RAND_Sample.PNG) ## Parameters | Parameter | JSON | Description | | --- | --- | --- | | **Table** | “targetTable”: “MyTableName” | The target table on which the new field will be created | | **Filter** | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter recordset will be returned as null. | | **Math** **Function** | “p1”: “RAND(A)” | RAND(A) | | **A** | “p2”: “NumericFieldName” “p2”: “#N*.N*” | Required. Numeric input for Maximum/Minimum value of created data. If A is less than 0, negative values will be created. If A is greater than 0, positive values will be created. Only integer values are returned - If A = 1, then RAND(A) will have a distribution between 0 and 1. *Supports:* - **DataType:** Discrete / Continuous - **Field Type:** Integer, Double - **Fixed Value:** #N* e.g. #201596, #-87 - **Fixed Value:** #N*.N* e.g. #201596.05, #-87.98 | | **Treat Null as Zero** | "nullIsZero": true "nullIsZero": false | True/False. Default = False If true, then any null values in the input fields will be treated as if they have a value of 0. | ## JSON Sample ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DMATH_RAND_JSON.PNG) ## Usage Notes See Also: - [DMATH Overview](https://datajet.document360.io/docs/dmathfunction-1) - Mathematical Expression Field - NRAND(A)  (DMATH) - BRAND(A)  (DMATH) - ANRAND(A)  (DMATH) - MIN(A+BANRAND(C),D)   (DMATH) - RAND(A)  (LMATH) ## Example | Example | Details | | --- | --- | | **Description** | Create a random distribution that is always between 0 and input A | | **Input** | - Table: = [customer] - Filter: = [No Filter] - Function: = DMath - **Math Function** **= RAND(A)** - A:= [customer ].[INPUT_A] - Name: = RAND_A | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DMATH_RAND_Example.PNG) |