I need help with building an MDX query to fetch date data.....
i am trying to get the last date an employee data was changed
i have 2 dimensions and 1 fact table (star schema)
fact table: fact_employee
dimension: date & employee_info
In fact table, i store a boolean field HasChanged?
1 - changed
0 - not changed
fact tbl looks like this
fact_id date_id user_id hasChanged
---------- ---------- ---------- ------------------
1 1 xxx 1
2 2 xxx 0
3 3 xxx 0
4 4 xxx 1
5 5 xxx 0
6 6 xxx 0
basically i want to be able to select the last time it has changed, in this case, when fact_id is 4.
I need a query that will go back in time and give me the last changed date!!! I would need this as a calculation because i am planning to pass the user_id into it to get the date
Any help would be highly appreciated.
Thanks
i am trying to get the last date an employee data was changed
i have 2 dimensions and 1 fact table (star schema)
fact table: fact_employee
dimension: date & employee_info
In fact table, i store a boolean field HasChanged?
1 - changed
0 - not changed
fact tbl looks like this
fact_id date_id user_id hasChanged
---------- ---------- ---------- ------------------
1 1 xxx 1
2 2 xxx 0
3 3 xxx 0
4 4 xxx 1
5 5 xxx 0
6 6 xxx 0
basically i want to be able to select the last time it has changed, in this case, when fact_id is 4.
I need a query that will go back in time and give me the last changed date!!! I would need this as a calculation because i am planning to pass the user_id into it to get the date
Any help would be highly appreciated.
Thanks