Seach

Seach

Table View

1. What is the Table View?

In Mitra components, the "Table VIEW" is one of the two visual development approaches used to define the data that will feed the component. Unlike the Data Analysis VIEW, which requires you to manually configure data and groupings, the Table VIEW automatically organizes everything based on the table you select. This simplifies the creation of tables perfectly suited for CRUD (Create, Read, Update, Delete) operations.

2. Structure of the Table View

The structure of the Table VIEW is similar to the Data Analysis VIEW, but its main distinction is that it relies on a specific table to automatically organize the data.

  • Table: The first step in configuring the Table VIEW is selecting a table (entity). For example, if you select the "Partners" table, Mitra organizes all attributes of that table as columns (data) and defines the table as the main grouping.

  • Grouper: The selected table (Partners) becomes the primary grouper that organizes the data.

  • Data: All attributes of the table (FKs, text, numeric, date) are automatically configured as columns in the table.

3. Differences from the Data Analysis View

The main difference of the Table VIEW is that, when selecting a table, it automatically configures the data and groupers. While in the Data Analysis VIEW you need to manually define which data and groupers to use, here the process is automated. This simplifies the creation of tables for CRUD operations, as all attributes of the table are already generated as data, ready for viewing and editing.

4. Common Features with the Data Analysis View

The "Data" in the Table View follows the same structure as in the Data Analysis View and can be of type "Attribute" or "Function."

4.1. Attribute

The attributes extracted from the table are automatically added as data and can be:

  • Normal Attribute: Includes numeric, textual, and date data directly extracted from the database.

  • FK Attribute: Relates the table's entity to other tables, displaying FKs as columns.

4.1.1. Normal Attribute

Numeric, textual, and date attributes are generated directly from the table.

Main functionalities include:

  • Aggregation Function: Choose how the data will be aggregated (sum, average, count, etc.).

  • Data Entry: Allows the user to insert or edit values directly in the table cells. For more information, refer to the "Data Entry" documentation.

  • Offset: Use the "Offset" to compare data from different periods, such as comparing current month sales with those of the previous year.

  • Additional Filters: Apply filters directly to the data. Example: View sales from different curves in separate columns. As shown below, view sales from "Curve A" in the first column, "Curve B" in the second column, and "Curve C" in the third column.

  • Conditional Formatting: In tables, you can apply conditional formatting based on cell values.

4.1.2. FK Attribute

FK Attributes are also generated automatically, allowing you to view relationships from the selected table. For example, when selecting the "Salespeople" table, you can include the related "Sales Manager”.

  • Relationship with Grouper: The FK attribute can only be used when it is related to a grouper, as described.

  • Data Entry with FK: It is possible to change the relationship directly in the View, such as changing the "Sales Manager" of a "Salesperson." For more information, refer to the "Data Entry" documentation.

Another interesting use of the FK attribute is when you want to utilize the description or code of the grouper in specific functions. For example, suppose you want to create a function where all salespeople with an ID less than 3 are classified as "2," and those with an ID greater than 3 are classified as "1." In this case, you will notice that the "Function Attribute" cannot directly access the values within the grouper, as it only works with data from the View. To achieve this, you can bring in the ID or description of the grouper as an "FK Attribute" and then use it within the function to define the criteria you want.

This criterion can be used, for example, in a column filter or even displayed directly to the user as a calculated value within the table.

4.2. Function

The "Function" in the Table View works the same way as in the Data Analysis View, allowing direct calculations and manipulations with the data.

  • Mathematical Expressions: Example: A / B, where A is sales value and B is sales quantity.

  • Concatenation: Use the addition operator (+) to concatenate values and strings. Example: A + " is greater than " + B.

  • Conditional If: Conditional structure: A > 100 ? 1 : 0.

  • JavaScript: Allows advanced manipulations, such as rounding functions, comparisons, and dynamic calculations.

  • _old Function: Allows you to compare the current value of a data point with the value of the previous row.

5. Groupers

The "Grouper" in the Table View is the selected table. You can define how related data will be displayed:

  • Description (default)

  • Code

  • Both (code followed by description)

6. Filters

The Table View also allows the application of filters:

  • Screen Filters: The View automatically respects the filters applied to the screen.

  • Additional Filters: Add specific filters within the View itself.

  • Column Filter: Allows filtering specific column values.

7. Sorting

The sorting of data in the Table View can be defined as:

  • Data Sorting: Example: sort partners by fee amount in descending order.

  • Grouper Sorting: Sort partners alphabetically or by any related attribute.

8. Record Limit

The Table View allows you to limit the number of records returned.

9. Conclusion

The Table View is a solution that streamlines the creation of tables for CRUD operations, automatically organizing data and groupings based on the selected table. It retains all the advanced features of the Data Analysis VIEW, providing a quick and efficient way to work with structured data without manually configuring each element.