![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a particularly lengthy query that I'm trying to speed up. I haven't got a clue how/if I can set this up as a cube, can someone advise? I have a table as follows: PrimaryKey CustomerID Date Attribute1 Attribute2 Attribute3 1 1 1/1/2003 1 1 1 2 1 2/2/2003 1 2 3 3 2 1/1/2003 1 3 4 3 2 3/3/2003 1 3 4 For example, I will query this table by supplying a date range and will return the sum of Attribute1. I will only select the most recent record for a CustomerID to go to the aggregation. How can I build in this date range selection taking the most recent records in my cube? Cheers |
#3
| |||
| |||
|
|
Not sure I completely understand your question but maybe you could use a SQL view to create your cube off of. -- Ray Higdon MCSE, MCDBA, CCNA --- |
#4
| |||
| |||
|
|
Thanks for taking the time to explain. I have transaxtional data which I would like to query. For example, key id date attribute1 attribute2 1 1 1/1/2001 1 1 2 1 1/2/2001 2 1 3 1 1/3/2001 3 1 4 2 1/1/2001 2 2 5 2 1/2/2001 3 2 6 2 1/3/2001 3 2 where key = primary key id = customer number date = transaction date attribute1 = sales band or whatever. attribute2 = customer score or whatever I have millions of these rows. What I need to do is query this data by given a data range for the transactions and also their sales band. I must only take the most recent customer record. So, for the six row example above I should only ever pull back two records. I don't know how I can design a cube on this "take most recent record" basis. |
#5
| |||
| |||
|
|
"Anthony Shorrock" <ashorrock (AT) SPAM (DOT) ME.NOT.hotmail.com> wrote in message news:%233IPB$PtDHA.3224 (AT) tk2msftngp13 (DOT) phx.gbl Just wondered why you were using a cube for this? Cubes aren't normally used for querying individual transactions. Why not just use SQL? |
#6
| |||
| |||
|
|
True, but I have millions of rows and sql isn't going to give me the answers I need - realtime. I have a web based report thing hanging off this. I am viewing a count of transactions rather than the transactions themselves. I can get near instantaneous results by querying a cube - ideal! However, I don't know how to work around the "most recent transaction" issue. Cheers "Nigel Pendse" <nigelp.nospam (AT) olapreport (DOT) com> wrote in message news:eC4XZTQtDHA.540 (AT) tk2msftngp13 (DOT) phx.gbl... "Anthony Shorrock" <ashorrock (AT) SPAM (DOT) ME.NOT.hotmail.com> wrote in message news:%233IPB$PtDHA.3224 (AT) tk2msftngp13 (DOT) phx.gbl Just wondered why you were using a cube for this? Cubes aren't normally used for querying individual transactions. Why not just use SQL? |
#7
| |||
| |||
|
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |