Seach

Seach

Dimension View

1. What is the Dimension View?

In Mitra components, the "Dimension View" is one of the three no-code methods for defining the data that will feed the component. Unlike the Data Analysis View, which requires you to manually configure the data and groupers, the Dimension View automatically organizes everything based on the selected record. This makes it ideal for creating tables perfect for CRUD (Create, Read, Update, Delete) operations.

2. Structure of the Dimension View

The structure of the Dimension View is similar to the Data Analysis View, but the key difference is that it is based on a specific record to automatically organize the data.

  • Record: The first step in configuring the Dimension View is to select a record (entity). For example, if you select the "Partners" record, Mitra will organize all attributes of that record as columns (data) and set the record as the grouper.

  • Grouper: The selected record (e.g., "Partners") becomes the main grouper, which organizes the data.

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

3. Differences from the Data Analysis View

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

4. Common Features with the Data Analysis View

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

4.1. Attribute

Attributes extracted from the record are automatically inserted as data and can be:

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

  • FK Attribute: Relates the record entity to other records, displaying FKs as columns.

4.1.1. Standard Attribute

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

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 automatically generated, allowing you to see relationships from the selected record. For example, when selecting the "Salesperson" record, you can bring in 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 Dimension 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 Dimension View is the selected record. You can define how related data will be displayed:

  • Description (default)

  • Code

  • Both (code followed by description)

6. Filters

The Dimension 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 Dimension 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 Dimension View allows you to limit the number of records returned.

9. Conclusion

The Dimension View is a no-code solution that speeds up the creation of tables for CRUD operations, automatically organizing the data and groupers based on the selected record. It retains all the advanced functionalities of the Data Analysis View, offering a quick and efficient way to work with structured data without having to manually configure each element.