Browse Source

chore: formula, lookup, rollup - right handside menu enable

Signed-off-by: Raju Udava <sivadstala@gmail.com>
pull/865/head
Raju Udava 3 years ago
parent
commit
333a58f789
  1. 134
      packages/noco-docs/content/en/setup-and-usages/formulas.md
  2. 54
      packages/noco-docs/content/en/setup-and-usages/link-to-another-record.md
  3. 39
      packages/noco-docs/content/en/setup-and-usages/lookup.md
  4. 69
      packages/noco-docs/content/en/setup-and-usages/rollup.md

134
packages/noco-docs/content/en/setup-and-usages/formulas.md

@ -1,80 +1,84 @@
---
title: 'Formulas'
description: 'Formulas'
position: 43
category: 'Usage'
menuTitle: 'Formulas'
title: "Formulas"
description: "Formulas"
position: 43
category: "Usage"
menuTitle: "Formulas"
---
## Adding Formula column
## Adding formula column
![Formula](https://user-images.githubusercontent.com/86527202/144246227-42c44df6-7e3e-4b2c-9bb9-a3c213bcad20.png)
#### 1. Click on '+' (Add column)
#### 2. Populate Column Name
#### 3. Select Column Type as 'Formula'
#### 4. Insert required formula
- Can use column names in equation
- Can use explicit numberical values/ strings as needed
- Table below lists supported formula & associated syntax
- Nested formula (formula equation referring to another formula column) are not supported
#### 5. Click on 'Save'
### 1. Click on '+' (Add column)
### 2. Populate column Name
### 3. Select column Type as 'Formula'
### 4. Insert required formula
- Can use column names in equation
- Can use explicit numberical values/ strings as needed
- Table below lists supported formula & associated syntax
- Nested formula (formula equation referring to another formula column) are not supported
### 5. Click on 'Save'
## Available Formula Features
### Functions
| Name | Syntax | Sample | Output | Minimum arguments |
|---|---|---|---|---|
| AVG | `AVG(value1, [value2,...])` | `AVG(Column1, Column1)` | Average of input parameters | 1 |
| ADD | `ADD(value1, [value2,...])` | `ADD(Column1, Column1)` | Sum of input parameters | 1 |
| CONCAT | `CONCAT(value1, [value2,...])` | `CONCAT(FirstName, ' ', LastName)` | Concatenated string of input parameters |
| TRIM | `TRIM(value1)` | `TRIM(Title)` | Removes trailing and leading whitespaces from input parameter |
| UPPER | `UPPER(value1)` | `UPPER(Title)` | Upper case converted string of input parameter |
| LOWER | `LOWER(value1)` | `LOWER(Title)` | Lower case converted string of input parameter |
| LEN | `LEN(value)` | `LEN(Title)` | Input parameter charachter length |
| MIN | `MIN(value1, [value2,...])` | `MIN(Column1, Column2, Column3)` | Minimum value amongst input parameters |
| MAX | `MAX(value1, [value2,...])` | `MAX(Column1, Column2, Column3)` | Maximum value amongst input parameters |
| CEILING | `CEILING(value1)` | `CEILING(Column)` | Rounded next largest integer value of input parameter |
| FLOOR | `FLOOR(value1)`| `FLOOR(Column)` | Rounded largest integer less than or equal to input parameter |
| ROUND | `ROUND(value1)`| `ROUND(Column)` | Nearest integer to the input parameter |
| MOD |`MOD(value1, value2)` | `MOD(Column, 2)` | Remainder after integer division of input parameters | 2 |
| REPEAT | `REPEAT(value1, count)`| `REPEAT(Column, 2)` | Specified copies of the input parameter string concatenated together |
| LOG | `LOG(value1, [base])`| `LOG(Column)` | Logarithm of input parameter to the base specified |
| EXP | `EXP(value1)` | `EXP(Column)` | Exponential value of input parameter (`e^x`) |
| POWER | `POWER(base, exponent)` | `POWER(Column, 3)` | `base` to the `exponent` power, as in `base^exponent` |
| SQRT | `SQRT(value1)` | `SQRT(Column)` | Square root of the input parameter |
| ABS | `ABS(value1)` | `ABS(Column)` | Absolute value of the input parameter |
| NOW | `NOW()` | `NOW()` | Current date time |
| REPLACE | `REPLACE(value1, old_str,new_str)` | `REPLACE(Column, old_string, new_String)` | String, after replacing all occurrences of `old_string` with `new_String` |
| SEARCH | `SEARCH(value1, search_val)` | `SEARCH(Column, 'str')` | Index of sub-string specified if found, 0 otherwise |
| INT | `INT(value1)` | `INT(Column)` | Integer value of input parameter |
| RIGHT | `RIGHT(value1, count)` | `RIGHT(Column, 3)` | `n` characters from the end of input parameter |
| LEFT | `LEFT(value1, [value2,...])` | `LEFT(Column, 3)` | `n` characters from the beginning of input parameter |
| SUBSTR | `SUBTR(value1, position, [count])` | `SUBSTR(Column, 3, 2)` | Substring of length 'count' of input string, from the postition specified |
| MID | `SUBTR(value1, position, [count])` | `MID(Column, 3, 2)` | Alias for `SUBSTR` |
| IF | `IF(expression, success_case, [else_case])` | `IF(Column > 1, Value1, Value2)` | success_case if expression evaluates to TRUE, else_case otherwise |
| SWITCH | `SWITCH(expression, [pattern,value,..., default_value])` | `SWITCH(Column1, 1, 'One', 2, 'Two', '--')` | Switch case value based on expression output |
| AND | `AND(expression1, [expression2,...])` | `AND(Column > 2, Column < 10)` | TRUE if all expressions evaluate to TRUE |
| OR | `OR(expression1, [expression2,...])` | `OR(Column > 2, Column < 10)` | TRUE if at least one expression evaluates to TRUE |
| Name | Syntax | Sample | Output | Minimum arguments |
| ------- | -------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------- | ----------------- |
| AVG | `AVG(value1, [value2,...])` | `AVG(Column1, Column1)` | Average of input parameters | 1 |
| ADD | `ADD(value1, [value2,...])` | `ADD(Column1, Column1)` | Sum of input parameters | 1 |
| CONCAT | `CONCAT(value1, [value2,...])` | `CONCAT(FirstName, ' ', LastName)` | Concatenated string of input parameters |
| TRIM | `TRIM(value1)` | `TRIM(Title)` | Removes trailing and leading whitespaces from input parameter |
| UPPER | `UPPER(value1)` | `UPPER(Title)` | Upper case converted string of input parameter |
| LOWER | `LOWER(value1)` | `LOWER(Title)` | Lower case converted string of input parameter |
| LEN | `LEN(value)` | `LEN(Title)` | Input parameter charachter length |
| MIN | `MIN(value1, [value2,...])` | `MIN(Column1, Column2, Column3)` | Minimum value amongst input parameters |
| MAX | `MAX(value1, [value2,...])` | `MAX(Column1, Column2, Column3)` | Maximum value amongst input parameters |
| CEILING | `CEILING(value1)` | `CEILING(Column)` | Rounded next largest integer value of input parameter |
| FLOOR | `FLOOR(value1)` | `FLOOR(Column)` | Rounded largest integer less than or equal to input parameter |
| ROUND | `ROUND(value1)` | `ROUND(Column)` | Nearest integer to the input parameter |
| MOD | `MOD(value1, value2)` | `MOD(Column, 2)` | Remainder after integer division of input parameters | 2 |
| REPEAT | `REPEAT(value1, count)` | `REPEAT(Column, 2)` | Specified copies of the input parameter string concatenated together |
| LOG | `LOG(value1, [base])` | `LOG(Column)` | Logarithm of input parameter to the base specified |
| EXP | `EXP(value1)` | `EXP(Column)` | Exponential value of input parameter (`e^x`) |
| POWER | `POWER(base, exponent)` | `POWER(Column, 3)` | `base` to the `exponent` power, as in `base^exponent` |
| SQRT | `SQRT(value1)` | `SQRT(Column)` | Square root of the input parameter |
| ABS | `ABS(value1)` | `ABS(Column)` | Absolute value of the input parameter |
| NOW | `NOW()` | `NOW()` | Current date time |
| REPLACE | `REPLACE(value1, old_str,new_str)` | `REPLACE(Column, old_string, new_String)` | String, after replacing all occurrences of `old_string` with `new_String` |
| SEARCH | `SEARCH(value1, search_val)` | `SEARCH(Column, 'str')` | Index of sub-string specified if found, 0 otherwise |
| INT | `INT(value1)` | `INT(Column)` | Integer value of input parameter |
| RIGHT | `RIGHT(value1, count)` | `RIGHT(Column, 3)` | `n` characters from the end of input parameter |
| LEFT | `LEFT(value1, [value2,...])` | `LEFT(Column, 3)` | `n` characters from the beginning of input parameter |
| SUBSTR | `SUBTR(value1, position, [count])` | `SUBSTR(Column, 3, 2)` | Substring of length 'count' of input string, from the postition specified |
| MID | `SUBTR(value1, position, [count])` | `MID(Column, 3, 2)` | Alias for `SUBSTR` |
| IF | `IF(expression, success_case, [else_case])` | `IF(Column > 1, Value1, Value2)` | success_case if expression evaluates to TRUE, else_case otherwise |
| SWITCH | `SWITCH(expression, [pattern,value,..., default_value])` | `SWITCH(Column1, 1, 'One', 2, 'Two', '--')` | Switch case value based on expression output |
| AND | `AND(expression1, [expression2,...])` | `AND(Column > 2, Column < 10)` | TRUE if all expressions evaluate to TRUE |
| OR | `OR(expression1, [expression2,...])` | `OR(Column > 2, Column < 10)` | TRUE if at least one expression evaluates to TRUE |
### Numeric Operators
| Operator | Sample | Description |
|---|---|---|
| `+` | `column1 + column2 + 2` | Addition of numeric values |
| `-` | `column1 - column2` | Subtraction of numeric values |
| `*` | `column1 * column2` | Multiplication of numeric values |
| `-` | `column1 / column2` | Division of numeric values |
| Operator | Sample | Description |
| -------- | ----------------------- | -------------------------------- |
| `+` | `column1 + column2 + 2` | Addition of numeric values |
| `-` | `column1 - column2` | Subtraction of numeric values |
| `*` | `column1 * column2` | Multiplication of numeric values |
| `-` | `column1 / column2` | Division of numeric values |
### Logical operators
| Operator | Sample | Description |
|---|---|---|
| `<` | `column1 < column2` | Less than |
| `>` | `column1 > column2` | Greater than |
| `<=` | `column1 <= column2` | Less than or equal to |
| `>=` | `column1 >= column2` | Greater than or equal to |
| `==` | `column1 == column2` | Equal to |
| `!=` | `column1 != column2` | Not equal to |
| Operator | Sample | Description |
| -------- | -------------------- | ------------------------ |
| `<` | `column1 < column2` | Less than |
| `>` | `column1 > column2` | Greater than |
| `<=` | `column1 <= column2` | Less than or equal to |
| `>=` | `column1 >= column2` | Greater than or equal to |
| `==` | `column1 == column2` | Equal to |
| `!=` | `column1 != column2` | Not equal to |

54
packages/noco-docs/content/en/setup-and-usages/link-to-another-record.md

@ -1,16 +1,17 @@
---
title: 'Link To Another Record'
description: 'Link To Another Record'
title: "Link To Another Record"
description: "Link To Another Record"
position: 39
category: 'Usage'
menuTitle: 'Link To Another Record'
category: "Usage"
menuTitle: "Link To Another Record"
---
### Relationship types:
- One to one
- A Table record in first table is related to only one record of second table.
- A Table record in first table is related to only one record of second table.
- Example: Country has a capital city
- One to many
- One to many
- A Table record in first table is related to more than one record of second table. But second table record maps to only one entry of first table
- NocoDB refers to this category of relationship as **has many**
- For every **has many** relation defined, NocoDB augments **belongs to** relationship column in the other table automatically
@ -19,7 +20,7 @@ menuTitle: 'Link To Another Record'
- A Table record in first table is related to more than one record of second table; second table record can also map to more than on record of first table.
- NocoDB refers to this category of relationship as **many to many**
- For every **many to many** relation defined between tables, NocoDB augments **many to many** relationship column in the other table automatically
- Example: Film **has many** Actors. Actor **has many** Films (works on many films)
- Example: Film **has many** Actors. Actor **has many** Films (works on many films)
Further details of relationship types can be found [here](https://afteracademy.com/blog/what-are-the-different-types-of-relationships-in-dbms)
@ -27,37 +28,50 @@ Relationships between table records can be established by using **LinkToAnotherR
Workflow details are captured below
## Adding a relationship
![1](https://user-images.githubusercontent.com/86527202/144224170-43f4194f-83d4-4291-8c91-1f66ea1caeda.png)
#### 1. Create Column
### 1. Create column
Click on '+' button at end of column headers
#### 2. Update Column Name
### 2. Update column name
Input name in the text box provided
#### 3. Select Column Type
### 3. Select column type
Select Column type as "LinkToAnotherRecord" from the drop-down menu
#### 4. Choose Relationship Type
### 4. Choose relationship type
'Has Many': corresponds to the 'One-to-many' relationships
'Many To Many': corresponds to the 'Many-to-many' relationships
#### 5. Select Child Table from drop down menu
#### 6. Click on Save
### 5. Select child table from drop down menu
### 6. Click on 'Save'
A new column will get created in both the parent table & child table
## Updating linked records
## Updating Linked records
### 1. Open link record tab
#### 1. Open link record tab
Click on the '+' icon in corresponding row - cell
![2truncate](https://user-images.githubusercontent.com/86527202/144224728-1cba50e3-323e-4578-be48-d2a205fb472c.png)
#### 2. Select from the option displayed
### 2. Select from the option displayed
Use 'Filter box' to narrow down on search items
You can opt to insert a new record as well, using "+ New Record" button
![3](https://user-images.githubusercontent.com/86527202/144224530-a258775f-1eea-4c79-88ed-a377d1e35a26.png)
#### 3. Column mapping showing "Has Many" relationship
### 3. Column mapping showing "Has Many" relationship
Country 'has many' City
#### 4. Column mapping for "Belongs to" relationship [Automatically updated]
City 'belongs to' Country
![4](https://user-images.githubusercontent.com/86527202/144224542-d28be060-a077-468a-bdc4-b2e8a783d75f.png)
### 4. Column mapping for "Belongs to" relationship [Automatically updated]
City 'belongs to' Country
![4](https://user-images.githubusercontent.com/86527202/144224542-d28be060-a077-468a-bdc4-b2e8a783d75f.png)

39
packages/noco-docs/content/en/setup-and-usages/lookup.md

@ -1,15 +1,15 @@
---
title: 'Lookup'
description: 'Lookup'
position: 41
category: 'Usage'
menuTitle: 'Lookup'
title: "Lookup"
description: "Lookup"
position: 41
category: "Usage"
menuTitle: "Lookup"
---
## Lookup
## Lookup
#### Sample simple Organization structure:
- 5 verticals, each vertical has a team name & associated team code
- 5 employees working at different verticals
- Vertical **has many** Employees : relationship has been defined
@ -18,27 +18,34 @@ menuTitle: 'Lookup'
Now, we can explore how to extract team-code information in Employee table using **"LOOKUP"** columns
#### 1. Add new column
## Adding a lookup column
### 1. Add new column
<img src="https://user-images.githubusercontent.com/86527202/144230901-11dc69e7-3e4d-481d-b682-b7d73e6352c0.png" width="60%"/>
Click on '+' icon to the left of column headers in Employee table
#### 2. Feed Column name
### 2. Feed column name
<img src="https://user-images.githubusercontent.com/86527202/144230954-40646872-4a05-45fd-9a4f-52b8b00a3a7d.png" width="60%"/>
#### 3. Select Column type as 'Lookup'
### 3. Select column type as 'Lookup'
<img src="https://user-images.githubusercontent.com/86527202/144230982-37d08274-ce63-4a28-a30a-bd6b41c3b489.png" width="60%"/>
#### 4. Choose Child Table
### 4. Choose child table
Table Verticals in our example
<img src="https://user-images.githubusercontent.com/86527202/144231016-b277270d-62e4-4607-9aaa-b253621808a0.png" width="60%"/>
#### 5. Select Child Column
### 5. Select child column
<img src="https://user-images.githubusercontent.com/86527202/144231774-2bdd9988-d3f8-4933-96c6-5b710d645905.png" width="60%"/>
#### 6. Click on Save
<img src="https://user-images.githubusercontent.com/86527202/144231320-9e8b3465-a9a4-4cf7-a9fe-65d47ab8b96c.png" width="60%"/>
### 6. Click on 'Save'
#### 7. Required information is populated in the newly created column
<img src="https://user-images.githubusercontent.com/86527202/144231230-0e013684-b11c-4dce-bacf-9feee5546f26.png" width="60%"/>
<img src="https://user-images.githubusercontent.com/86527202/144231320-9e8b3465-a9a4-4cf7-a9fe-65d47ab8b96c.png" width="60%"/>
### 7. Required information is populated in the newly created column
<img src="https://user-images.githubusercontent.com/86527202/144231230-0e013684-b11c-4dce-bacf-9feee5546f26.png" width="60%"/>

69
packages/noco-docs/content/en/setup-and-usages/rollup.md

@ -1,15 +1,15 @@
---
title: 'Rollup'
description: 'Rollup'
title: "Rollup"
description: "Rollup"
position: 42
category: 'Usage'
menuTitle: 'Rollup'
category: "Usage"
menuTitle: "Rollup"
---
## Rollup
Sample simple Organization structure:
- 5 verticals, each vertical has a team name & associated team code
- 5 employees working at different verticals
- Vertical **has many** Employees : relationship has been defined
@ -17,6 +17,7 @@ Sample simple Organization structure:
![LookUp](https://user-images.githubusercontent.com/86527202/144038845-402d5401-a214-4166-bc07-fcf8dcc8a961.png)
### RollUp AGGREGATION functions supported
- Count
- Minimum
- Maximum
@ -28,40 +29,44 @@ Sample simple Organization structure:
Now, we can explore how to extract employee count information per vertical using **"ROLLUP"** columns
#### 1. Add new column
Click on '+' icon to the left of column headers in Verticals table
## Adding a rollup column
![1](https://user-images.githubusercontent.com/86527202/144236273-484edc5b-7f5f-4041-b480-db08d4459d07.png)
#### 2. Feed column name
### 1. Add new column
![2](https://user-images.githubusercontent.com/86527202/144236279-41904955-4990-4a23-bec6-b0953002eac6.png)
Click on '+' icon to the left of column headers in Verticals table
#### 3. Select Column type as 'Rollup'
![1](https://user-images.githubusercontent.com/86527202/144236273-484edc5b-7f5f-4041-b480-db08d4459d07.png)
![3](https://user-images.githubusercontent.com/86527202/144236283-4596e3e1-3bf8-488f-bc9b-8ec1466a35c6.png)
#### 4. Choose Child Table
Table Employee in our example
### 2. Feed column name
![4](https://user-images.githubusercontent.com/86527202/144236284-301178d8-f452-4d1e-9dff-80dd9570c280.png)
#### 5. Choose on Child column
Pick appropriate column for aggreagation
![2](https://user-images.githubusercontent.com/86527202/144236279-41904955-4990-4a23-bec6-b0953002eac6.png)
![5](https://user-images.githubusercontent.com/86527202/144236286-28547d74-feb8-4ad8-a872-7ba809e5db1e.png)
#### 6. Select Aggregate function
Aggregate function will be "count" in our case
### 3. Select Column type as 'Rollup'
![6](https://user-images.githubusercontent.com/86527202/144236288-34a567d5-a5e9-4a1e-b074-5ea633e799a3.png)
#### 7. Click on Save
![3](https://user-images.githubusercontent.com/86527202/144236283-4596e3e1-3bf8-488f-bc9b-8ec1466a35c6.png)
![7](https://user-images.githubusercontent.com/86527202/144236289-5872529a-ba47-428d-979e-fdefb92a1039.png)
#### 8. Column TeamCount is populated with appropriate information
![8](https://user-images.githubusercontent.com/86527202/144236291-52855f92-ad8b-4be1-aa98-b5cfdb1ee108.png)
### 4. Choose Child Table
Table Employee in our example
![4](https://user-images.githubusercontent.com/86527202/144236284-301178d8-f452-4d1e-9dff-80dd9570c280.png)
### 5. Choose on Child column
Pick appropriate column for aggreagation
![5](https://user-images.githubusercontent.com/86527202/144236286-28547d74-feb8-4ad8-a872-7ba809e5db1e.png)
### 6. Select Aggregate function
Aggregate function will be "count" in our case
![6](https://user-images.githubusercontent.com/86527202/144236288-34a567d5-a5e9-4a1e-b074-5ea633e799a3.png)
### 7. Click on Save
![7](https://user-images.githubusercontent.com/86527202/144236289-5872529a-ba47-428d-979e-fdefb92a1039.png)
### 8. Column TeamCount is populated with appropriate information
![8](https://user-images.githubusercontent.com/86527202/144236291-52855f92-ad8b-4be1-aa98-b5cfdb1ee108.png)

Loading…
Cancel
Save