Page 1 of 1
Time period Dimension
Posted: Tue Nov 03, 2020 10:06 pm
by manu0521
Hi ,
We had this time period dimension as a static dimension and add the year and months once a year.
Now I am trying to automate using a TI to build this .
For few dimensions we remove the hierarchies to the lowest level and then readd them .Since elements might switch positons.
For time ,Am i good with just adding the members .I am planning to just check the current year column value from the source table with system year and then add only the members until the current year.
Thanks,
Re: Time period Dimension
Posted: Tue Nov 03, 2020 10:12 pm
by tomok
manu0521 wrote: ↑Tue Nov 03, 2020 10:06 pm
Hi ,
We had this time period dimension as a static dimension and add the year and months once a year.
Now I am trying to automate using a TI to build this .
For few dimensions we remove the hierarchies to the lowest level and then readd them .Since elements might switch positons.
For time ,Am i good with just adding the members .I am planning to just check the current year column value from the source table with system year and then add only the members until the current year.
Thanks,
I have my time dimension in an .XDI sheet and I can add a new year in literally less than five minutes. Copy and paste and then replace the year value. Voila. I would never ever get payback in time savings for the time I would waste building a TI to do this. YMMV.
Re: Time period Dimension
Posted: Tue Nov 03, 2020 11:29 pm
by Wim Gielis
I would loop from a pStartYear until a pEndYear (2 parameters to the process).
Within that loop, I would loop over 12 periods.
A couple of DimensionElementInsert's and DimensionElementComponentAdd's (or the Hierarchy equivalents) and that's basically it.
In the Epilog tab, add a few attributes.
I would think that with 90 posts here and having joined the forum in 2014, this would be an easy task.
Re: Time period Dimension
Posted: Wed Nov 04, 2020 12:02 pm
by tomok
Another thing about the XDI. You can very easily control the ordering of the elements. Doing this via TI is extremely difficult. Our users like to have the current year at the top of the time dimension by default. With an XDI I can move that year to the top and save and it's done. I know I can create a subset that has this but once the user clicks on the Show All everything goes back to the default. It is very handy to have the elements in the dimension in the optimal order to start with. An XDI is the easiest way to accomplish this.
Re: Time period Dimension
Posted: Wed Nov 04, 2020 2:21 pm
by Wim Gielis
I bet not many of us have used the second argument (Insertion point) in a function like DimensionElementInsert

For me, I can count those situations on 1 hand.
Re: Time period Dimension
Posted: Wed Nov 04, 2020 2:51 pm
by tomok
Wim Gielis wrote: ↑Wed Nov 04, 2020 2:21 pm
I bet not many of us have used the second argument (Insertion point) in a function like DimensionElementInsert

For me, I can count those situations on 1 hand.
I know about that one but the problem for me isn't the position of the newly inserted elements, it's the ability to re-order the existing ones. I can do that with XDI but there isn't a way to do that with TI unless I remove the element and re-add, which we all know is a no-no if you have data.
Re: Time period Dimension
Posted: Wed Nov 04, 2020 3:10 pm
by Wim Gielis
tomok wrote: ↑Wed Nov 04, 2020 2:51 pm
Wim Gielis wrote: ↑Wed Nov 04, 2020 2:21 pm
I bet not many of us have used the second argument (Insertion point) in a function like DimensionElementInsert

For me, I can count those situations on 1 hand.
I know about that one but the problem for me isn't the position of the newly inserted elements, it's the ability to re-order the existing ones. I can do that with XDI but there isn't a way to do that with TI unless I remove the element and re-add, which we all know is a no-no if you have data.
I haven't tested this, nor do I say it's intuitive and needed and easy, but if we do a DimensionDeleteAllElements and insert them back in the correct sequence - I *think* this could work.
Re: Time period Dimension
Posted: Mon Nov 09, 2020 10:46 pm
by PavoGa
tomok wrote: ↑Wed Nov 04, 2020 2:51 pm
Wim Gielis wrote: ↑Wed Nov 04, 2020 2:21 pm
I bet not many of us have used the second argument (Insertion point) in a function like DimensionElementInsert

For me, I can count those situations on 1 hand.
I know about that one but the problem for me isn't the position of the newly inserted elements, it's the ability to re-order the existing ones. I can do that with XDI but there isn't a way to do that with TI unless I remove the element and re-add, which we all know is a no-no if you have data.
Not necessarily with alternate hierarchies. Remove the N-levels in the target hierarchy and the Leaves hierarchy protects against loss. Not saying I do it that way (old school unwind and rebuild), but that is one of the advantages of the alternate hierarchies.
Re: Time period Dimension
Posted: Mon Nov 09, 2020 10:50 pm
by PavoGa
Wim Gielis wrote: ↑Wed Nov 04, 2020 3:10 pm
I haven't tested this, nor do I say it's intuitive and needed and easy, but if we do a DimensionDeleteAllElements and insert them back in the correct sequence - I *think* this could work.
I believe you are correct in your thinking. As long as all the dimension changes occur in the prolog and METADATA procedures, the underlying data is kept as the changes occur on a copy of the dimension, not the actual dimension. Think I tried this some years back, but frankly, I manage this in other ways.
Re: Time period Dimension
Posted: Tue Nov 24, 2020 10:31 pm
by paulsimon
Hi
This post might help you
viewtopic.php?f=21&t=15596
It generates a time dimension using TI with the elements in the right order.
Regards
Paul Simon