COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Transformer => Topic started by: Rosanero4Ever on 07 Sep 2015 05:22:09 AM

Title: Remove"wrong" categories in time dimension
Post by: Rosanero4Ever on 07 Sep 2015 05:22:09 AM
Hi all,

I have a time dimension with some hierachies.
Two of these hierarchies are YTD and Prior YTD.
If my customer make a mistake inserting a future date used for this time dimension, e.g. 07/09/2051 instead of 07/09/2015, the categories for YTD hierarchy refers to year 2051!
When customer correct the date,  categories for YTD aren't updated and YTD refers to year 2051.
In this case, I need to open the mdl file deleting manually categories and then I rebuild the cube.
So, how can I automatically update YTD removing 2051 categories and considering 2015 dates?
The same issue affects Prior YTD
Thanks so much in advance for your precious help
Title: Re: Remove"wrong" categories in time dimension
Post by: Rosanero4Ever on 07 Sep 2015 08:46:55 AM
Because, I'm not sure that clean house could help me to solve the described scenario, I applied this workaround:
1. I created a clean mld file: I deleted all categories that can be created each time cube is rebuild while I didn't delete "static" categories
2. In my bat script for daily cube update, I put a line in order to copy the above mdl file in another mdl file. In this way the build process is executed on the second file

Using this method I always should have "fresh" data

What do you think about this work around?
Title: Re: Remove"wrong" categories in time dimension
Post by: nav_shiv on 07 Sep 2015 11:04:51 AM
For me having a 'clean' Model is normal.  The only categories I would leave in are the manually created ones.

I wouldn't do a clean house, I think that may remove all the special time categories you may have created manually.

I'm surprised the model did not fix itself after 2051 was fixed to 2015.  It could be that you have more than one Data Source that has the set current period box ticked?
Title: Re: Remove"wrong" categories in time dimension
Post by: Rosanero4Ever on 07 Sep 2015 11:09:31 AM
uhm...i have to check this option but i'm sure that other data sources don't store date information.
Title: Re: Remove"wrong" categories in time dimension
Post by: nav_shiv on 07 Sep 2015 11:18:07 AM
I'd also check that the data source that sets current period is at the top of your list.  And to be certain, run a Data Source Viewer on it to check it is returning 2015.
Title: Re: Remove"wrong" categories in time dimension
Post by: bdbits on 08 Sep 2015 10:00:26 AM
I've occasionally seen categories get 'stuck' like this. I do not recommend a clean house operation, as this will potentially rebuild MUNs that are referenced in reports.

Right-click the dimension map and choose Categories. Pick your time dimension on the left, and you should be able to find your rogue category. Then just right-click and Delete it.