3,113 questions
Best practices
0
votes
2
replies
119
views
How to model and persist entities whose state changes over time
I’m designing a domain model where some entities evolve over time, and I need to keep a historical record of their state that can be retrieved later.
A simplified example:
A Credit Line represents a ...
1
vote
1
answer
70
views
Power BI / Microsoft Fabric Semantic Model – “Sort by column” not working
Screenshot from DAX Studio
Screenshot from Semantic Model
I’m working in a Microsoft Fabric Semantic Model (same behavior as Power BI Desktop model) and I’m trying to sort one column by another using ...
2
votes
1
answer
47
views
Query based on fields from 2 different Collections in MongoDB
I am developing web application using Gin and MongoDB. I have defined models for user like,
type User struct {
Id nftdb.ObjID `bson:"_id,omitempty"`
Tenant string
...
1
vote
1
answer
256
views
Implement Slowly Changing Dimensions (SCD) - Type 2 Using DuckDB
I want to implement SCD-Type2, and keep track of historized data, I am using for this task DuckDB, but I found out that DuckDB does not support Merge Statement.
The idea I have is to have two separate ...
0
votes
1
answer
29
views
Dimensional Modeling- How to handle Code-Name-Description lookup table
Is there a best practice to handle OLTP lookup tables( code-name-description tables) when converting to Dimension? Eg, the ACCOUNT table in OLTP has almost 15 codes (Eg: TRADING_PLATFORM_CD, ...
1
vote
1
answer
66
views
Is a localField $lookup faster than a pipeline?
In MongoDB (version 8) I'm wondering about the most read-efficient way of storing a "sharing mechanism". I.e. the users can share items with other items within the same collection.
When ...
0
votes
1
answer
88
views
a confusion about schema design for storing store's profits and how to retrieve them in mongoose [closed]
For displaying the (daily-weekly-monthly-annual) total profits for the store's dashboard.
I want to store the data in an array for each store to not have multiple docs for the same store but different ...
-1
votes
1
answer
114
views
How to draw an ER diagram where there are 2 entities with exactly same attributes
Each appliance is classified as either: Kitchen appliances, Entertainment appliances, and it’s important to keep track of their type.
Kitchen appliances and Entertainment appliances have details about ...
0
votes
1
answer
82
views
Power BI matrix - get data into correct format
I'm usually quite good with Power BI, but weirdly stuck on this matrix, that I'm trying to create. I just can't seem to get the data in the right format to produce the below chart. Can anybody help?
...
0
votes
0
answers
24
views
How to optimize a data model with bidirectional filtering?
I have Product dim that filters the FactSales (1:M)
And Charges dim that filters the FactCharges (1:M)
There is a bridge table with a key value (concat of saleid, poid). This has a 1:M relation with ...
0
votes
0
answers
24
views
Power BI relationships
I created following data set as illustrated below:
You can see four level's.
level 4: the records that tie everthing together, in this case : reservations. Or more precisely: object-reservations, ...
0
votes
0
answers
99
views
How to Use a Dimension for Filtering While Avoiding SQL Execution in Looker?
I’m working on a Looker project with two main datasets:
Table A: Contains only id values and other related data.
Table B: Maps id values to human-readable name values (e.g., id-name).
My goal is to ...
0
votes
1
answer
45
views
Obtain avg number of monthly active customers on the web over the past 6 months. An active cust is one that has purchased within the prior 12 mnths
I am seeking help with a complex data modelling problem I am trying to solve. Was wondering if any kind soul with a good SQL expertise is able to help me.
The question is: obtain the average number of ...
1
vote
1
answer
69
views
Optimizing low-level structure for CPU memory performance in my game simulator [closed]
I am writing a world simulator for a turn-based game. The key feature is that there will be many NPCs with detailed psychology modelling, perhaps 20,000 - 30,000 of them. I want all NPCs to make their ...
-1
votes
1
answer
74
views
Kimball Model Design - When to Snow or Star
I have data model for a Kimball style data warehouse. Regarding the whole Star vs Snowflake schema conundrum when it comes to dimensional tables and their ownership.
Scenario: A bunch of IoT Devices ...
-1
votes
3
answers
168
views
What is a good way to determine if all fields on a record except one are empty?
I've got a record that I use for making update requests via json/Jackson:
public record UpdateRequest(
Optional<String> field1,
Optional<LocalDate> field2,
Optional<@Max(24) ...
1
vote
0
answers
121
views
How to model change log history for opensearch document property, and aggregate on it?
I need to keep track of changes to a particular field in an opensearch document, and to be able to find aggregations on that field per date basis (for example, per day), or find count/IDs of docs that ...
0
votes
0
answers
49
views
Query is not working properly in my Mern app
I'm building a lead data website using the MERN stack. Users can filter data based on various criteria like country, city, job title, seniority, industries, department, email type, and more (over 10 ...
0
votes
1
answer
54
views
Determining the Appropriate Grain for a Pharmacy Consultation and Prescription Fact Table
I’m working on a data warehouse for a pharmacy business process and need some advice on determining the appropriate grain for the fact table.
The business process is as follows:
A pharmacy provides ...
0
votes
1
answer
292
views
A relationship is not working when using a measure
My model contains a fact table and a dimension. The dimension contains Full Name, Login, Access, DOMAIN. Domain is a numeric number which is used as a key to the fact table. Here is some dummy data:
...
0
votes
0
answers
74
views
Can nullable column (column with blanks) be made into a dimension table?
I have a fact table called ProjectTasks.
It's a left join of project and tasks table. A project can have 0 or more tasks. Thus for projects that don't have any task, the task columns are nulls (blanks)...
0
votes
1
answer
210
views
How to handle multiple dimension records having the same name even though they have unique key/relation with the fact table (1:M)? [closed]
I'm looking at Product dimension table.
It has got products table obtained by performing a SQL UNION between Product tables in 2 databases. The columns are:
Dbname,productid,productname,...
0
votes
0
answers
39
views
Is this star schema model valid or does it required updates to be more efficient?
I am working with a DataWarehouse from which I'll be collecting data, I am trying to build a star model schema on data modeler in order to be then use on Snowflake and then later in Power BI for BI ...
1
vote
0
answers
34
views
Is it okay to flatten hierarchical data in MongoDB and repeat data in the documents
I'm trying to model the data as follows. Is this good practice or is there a better way so that I don't have to repeat the data in the checklist collection.
/* technical book 1
reference number
...
0
votes
1
answer
37
views
Is there a way to relate a Calendar lookup table and a 24hr Time lookup table to 2 different tables on more than 1 column in PowerBI?
I have 2 tables, encounters table and procedures table, that both have 2 columns containing a date data type and 2 columns containing a time data type. I have created a Calendar lookup and a Time ...