![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, My nigthly job should process last partition. I use AMO object model Server.Execute method. But how to known the last partition ID? Now I use AmoServer.Databases("db_id").Cubes("cube ID").MeasureGroups("Measure Group ID").Partitions(NumberOfPartitions - 1).ID but this method returns not the last partition in my measure group, but the last created partition. I mean if I have partitions slst_2005, slst_2006 and then created slst_2002, slst_2003, slst_2004, so this method will return slts_2004. I would like to get the slst_2006 one. Of course, i can programically do a loop through measure group partitions and take partition with max name. But I hope there are more elegant way. Any suggestions? May I could make select from analysis services repository in some way?? Ramunas |
#3
| |||
| |||
|
|
I had a similar problem, but I choose to resolve it different way. I basically maintain a list of SSAS partitions in SQL Server table. I also have a flag on each partition if it has to be processed or no. Then I have SSIS package that creates new partitions in SSAS and drops non existing partitions from SSAS based on records in that table. After that my SSIS package process all partitions that have required processing flag to 1 and then resets flag to 0. My DW load SSIS package changes partition required processing flag to 1 for partitions that requires to be reporcessed after re-load. Also special routine creates/drops records from this table when required.Altough it might sound complicated, it is not really. This is just an idea as nobody else replied to your original problem. Regards, "Ramunas Balukonis" <ramblk2 (AT) hotmail (DOT) com> wrote in message news:1164706163.513596 (AT) loger (DOT) vpmarket.int... Hi, My nigthly job should process last partition. I use AMO object model Server.Execute method. But how to known the last partition ID? Now I use AmoServer.Databases("db_id").Cubes("cube ID").MeasureGroups("Measure Group ID").Partitions(NumberOfPartitions - 1).ID but this method returns not the last partition in my measure group, but the last created partition. I mean if I have partitions slst_2005, slst_2006 and then created slst_2002, slst_2003, slst_2004, so this method will return slts_2004. I would like to get the slst_2006 one. Of course, i can programically do a loop through measure group partitions and take partition with max name. But I hope there are more elegant way. Any suggestions? May I could make select from analysis services repository in some way?? Ramunas |
#4
| |||
| |||
|
|
Hi, Vimas, thanks, but it seems a bit comlicated. But I think SSAS stores metada in some repository and I believe that I could select data directly. Ramunas "Vimas" <Vimas (AT) nospam (DOT) nospam> wrote in message news:ei17w99EHHA.4108 (AT) TK2MSFTNGP03 (DOT) phx.gbl... I had a similar problem, but I choose to resolve it different way. I basically maintain a list of SSAS partitions in SQL Server table. I also have a flag on each partition if it has to be processed or no. Then I have SSIS package that creates new partitions in SSAS and drops non existing partitions from SSAS based on records in that table. After that my SSIS package process all partitions that have required processing flag to 1 and then resets flag to 0. My DW load SSIS package changes partition required processing flag to 1 for partitions that requires to be reporcessed after re-load. Also special routine creates/drops records from this table when required.Altough it might sound complicated, it is not really. This is just an idea as nobody else replied to your original problem. Regards, "Ramunas Balukonis" <ramblk2 (AT) hotmail (DOT) com> wrote in message news:1164706163.513596 (AT) loger (DOT) vpmarket.int... Hi, My nigthly job should process last partition. I use AMO object model Server.Execute method. But how to known the last partition ID? Now I use AmoServer.Databases("db_id").Cubes("cube ID").MeasureGroups("Measure Group ID").Partitions(NumberOfPartitions - 1).ID but this method returns not the last partition in my measure group, but the last created partition. I mean if I have partitions slst_2005, slst_2006 and then created slst_2002, slst_2003, slst_2004, so this method will return slts_2004. I would like to get the slst_2006 one. Of course, i can programically do a loop through measure group partitions and take partition with max name. But I hope there are more elegant way. Any suggestions? May I could make select from analysis services repository in some way?? Ramunas |
#5
| |||
| |||
|
|
Hi Ramunas, It makes sense for the SSAS to return the partiton in the order of creation. There can be only one order to store the partitions, so the SSAS chooses the natural way to put the partititons into its collection in the order of when it was created. In order to get your last partition, you can retrieve the whole partition list and sort them by the the descending order, then the first in the list is your last partition. "Ramunas Balukonis" wrote: Hi, Vimas, thanks, but it seems a bit comlicated. But I think SSAS stores metada in some repository and I believe that I could select data directly. Ramunas "Vimas" <Vimas (AT) nospam (DOT) nospam> wrote in message news:ei17w99EHHA.4108 (AT) TK2MSFTNGP03 (DOT) phx.gbl... I had a similar problem, but I choose to resolve it different way. I basically maintain a list of SSAS partitions in SQL Server table. I also have a flag on each partition if it has to be processed or no. Then I have SSIS package that creates new partitions in SSAS and drops non existing partitions from SSAS based on records in that table. After that my SSIS package process all partitions that have required processing flag to 1 and then resets flag to 0. My DW load SSIS package changes partition required processing flag to 1 for partitions that requires to be reporcessed after re-load. Also special routine creates/drops records from this table when required.Altough it might sound complicated, it is not really. This is just an idea as nobody else replied to your original problem. Regards, "Ramunas Balukonis" <ramblk2 (AT) hotmail (DOT) com> wrote in message news:1164706163.513596 (AT) loger (DOT) vpmarket.int... Hi, My nigthly job should process last partition. I use AMO object model Server.Execute method. But how to known the last partition ID? Now I use AmoServer.Databases("db_id").Cubes("cube ID").MeasureGroups("Measure Group ID").Partitions(NumberOfPartitions - 1).ID but this method returns not the last partition in my measure group, but the last created partition. I mean if I have partitions slst_2005, slst_2006 and then created slst_2002, slst_2003, slst_2004, so this method will return slts_2004. I would like to get the slst_2006 one. Of course, i can programically do a loop through measure group partitions and take partition with max name. But I hope there are more elegant way. Any suggestions? May I could make select from analysis services repository in some way?? Ramunas |
![]() |
| Thread Tools | |
| Display Modes | |
| |