Hazim, here’s how I would describe how analytics references these objects: When you add a category, there is a checkbox for “Data Dimension” that tells whether this category should be used as a dimension in analytics. If you check “Data Dimension”, then analytics displays a dimension whose values are the category options in this category. For each category, you also choose a “data dimension type” of “Disaggregation” or “Attribute”. If you have a “Disaggregation” category, then analytics can show data where the data value’s category option combo references a combination containing a selected category option. For example, if you check “Data Dimension” for a disaggregation category “Age”, then analytics will show an “Age” dimension with options such as “<15”, “15+”, or whatever category options are in the category “Age”. Then data is shown based on any category option combos that include the category options “<15” or “15+”. (The data could be disaggregated by a combination of a category “Age” and a category “Sex”, in which case choosing the dimension item “<15” will show data for the category option combinations “<15, Female” as well as “<15, Male”.)
If you have an “Attribute” category, then analytics can show data where the data value’s attribute option combination contains this category option. For example, if you check “Data Dimension” for an attribute category “Project”, then analytics will show a “Project” dimension with objects such as “Project 1234”, “Project 5678”, or whatever category options are in the category “Project”. Then data is shown based on any attribute option combos that include the category options “Project 1234” or “Project 5678”. (The attribute option combo could reference other attribute options, such as a combination of a category “Project” and a category “Open/Closed status”, in which case analytics would show data for the attribute option combinations “Project 1234, Open” as well as “Project 1234, Closed”.)
Likewise, When you add a Category Option Group Set (COGS), there is also a “Data Dimension” checkbox, and you also choose a data dimension type of “Disaggregation” or “Attribute”. If you check “Data Dimension”, then analytics will show this COGS as a dimension from which you can choose one or more Category Option Groups (COG’s) belonging to this group set. If you have a “Disaggregation” COGS, then data is shown based on any category option combos that include a category option belonging to a selected category option group. For example, you could create a disaggregation COGS “Child/Adult” with COG’s “Child” and “Adult”. The “Child” group could contain category options such as “0-2”, “3-5”, “6-14” as used in finer age disaggregations, and also the category option “<15”, as used in coarse age disaggregations. Then data is shown based on any of the category option combos (e.g. “3-5, Female”) containing a category option (e.g. “3-5”) belonging to a selected COG (e.g. “Child”.)
If you have an “Attribute” COGS with “Data Dimension” checked, then data is shown based on any attribute option combos that include a category option belonging to a selected category option group. For example, you could create an attribute COGS “Partner” with COG’s “Partner A” and “Partner B”. Partner A could be a group of category options “Project 1234” and “Project 5678”, and Partner B could be a group of category options “Project 2345” and “Project 6789”. Then data is shown based on any of the attribute option combos (e.g. “Project 1234, Open”) containing an attribute option (e.g. “Project 1234”) belonging to a selected COG (e.g., “Partner A”.)
How this all works in the database is that each analytics table contains a column for each data dimension (such as the disaggregation category “Age”, the attribute category “Project”, the disaggregation COGS “Child/Adult”, or the attribute COGS “Partner”.) Each row in the analytics table contains the UID (if any) for the item that may be selected in this dimension (such as the category option that may be selected for a category, or the COG that may be selected for a COGS.) So in your data model, you could show many-to-one relations from the analytics tables (of which there are several), to Category option, and to Category option group. These are not represented by foreign keys in the database, but are used by analytics to locate the dimension items selected.
I hope this helps!