Can we implement role play dimension logic like Order Date, Ship Date, Delivery Date, etc?

Can we implement role play dimension logic like Order Date, Ship Date, Delivery Date, etc?

For example, suppose we are designing a fact table which captures purchasing data, we can have multiple dates in this scenario like Order Date, Ship Date, Order Received Date, etc. In these kinds of situations, we need to have different date keys stored in the fact table (like OrderDateKey, ShipDateKey, DeliveryDateKey, etc…) to get the different date information while browsing the fact table.

How can we these kinds of relations with the calendar?

How can we draw a distribution of the number of orders, ships and deliveries month by month. Note that it is a distribution on a single time axis.

0 1 125
1 REPLY 1

clathrop
Participant II

You could use a parameter (acts like a filter) and put it at the top of the page. Something like 

  parameter: date_selection {
allowed_value: {label: "Order Date", value: "order_date"}
allowed_value: {label: "Ship Date", value: "ship_date"}
}

Then in your date dimension group, use Liquid something like this

dimension_group: variable_date {

sql: {% case date_selection._parameter_value %}
{% when 'order_date' %} ${order_date_dim}
{% when 'ship_date' %} ${ship_date_dim}
{% endcase %} ;;
}
Top Labels in this Space
Top Solution Authors