Get the most recent value in a table filtred by date in another table

  Kiến thức lập trình

I have the following tables in SSAS tabular cube:

F_Sales       : Invoice_key(FK), AMT
D_Invoice     : Invoice_key(PK), Productline_key(FK)
D_ProductLine : ProductLine_key(PK), Prd_key(FK), ProductLine_Type, ProductLine_Date
D_Product     : Prd_key(PK), Prd_Code
D_Situation   : Situation_key, ProductLine_key(FK), Situation_Type, Situation_Date

User filters : Date
             : He can choose or not a ProductLine_Type (optional)

I want to get the SUM(AMT) From F_Sales for every Prd_Code having the most recent ProductLine_Date with the associated Productline_Type filtered by Situation_date <= filter date chosen by user, for example:

New contributor

Borri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT