Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDX query

Status
Not open for further replies.

aleks1429

Programmer
Aug 12, 2004
3
US
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


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top