Thomas Karbe
08/08/2024, 11:10 AMThomas Karbe
08/08/2024, 11:10 AMJoseph Heun
08/08/2024, 12:23 PMThomas Karbe
08/08/2024, 12:26 PMMichal Hauzírek
08/09/2024, 10:48 PMThomas Karbe
08/10/2024, 5:02 AMMichal Hauzírek
08/10/2024, 6:25 AMThomas Karbe
08/10/2024, 7:03 AMMichal Hauzírek
08/19/2024, 3:17 PMDim SaaS State
dataset a combination/concatenation of Brand Key
and SaaS State Month
• using this key connect Dim SaaS State
directly to fact rewards
(arrow from dim to fact)
◦ first part of the key - Brand Key
is already present in the Fact Rewards
◦ second part of the key - the date/month can be derived from the CreatedAt
Date (this solves the created_month=saas_state_month
condition)
◦ so i.e. a reward row with brand key ‘X’ and createdAt date ‘2024-08-19’ would have the combined foreign key ‘X-2024-08-01’ (date truncated to month)
• completely remove the existing link between Dim SaaS State
and Dim Brand
(to avoid loop within the model)
(see such model in the attachment - I only used the main columns for simplicity)
This way, the SaaS States
keeps monthly snapshots of SaaS State for each brand, the appropriate SaaS state is always referenced from the Fact Rewards
dataset, without need for any complex metric.
And you can simply view SUM of Reward Value by SaaS State, Brand and SaaS Date as @Masha Akatieva wanted.
I hope I am not missing something, but to me this sounds like the most elegant solution.
The limitation is, that you can no longer analyze the SaaS States
by Brand
without rewards, but I am not sure if that was needed And if it was, you could add new (factless?) fact table connecting these two together.Thomas Karbe
08/19/2024, 3:34 PMThomas Karbe
08/19/2024, 3:35 PM