If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

to get last 4 months data

Started by karthik12345, 27 Jan 2016 02:49:36 AM

Previous topic - Next topic

karthik12345

Hi all,
  I am using tm1 cube as a data source in cognos, my requirment is i need to show last 4 months data indivisually and the report should be dynamic. Please suggest me how can i get this.

Thanks,
Karthee

BigChris

Have you got a rolling 4 month dimension in your cube?

Lynn

A relative time dimension is the best way to go for sure.

If, however, you need to compute it you could use the tail function to get the last member of your date dimension, and then use the lastPeriods function to get a set of the last four members.




lastPeriods ( 4 , tail ( members ( [YourCube].[YourDateDim].[YourDateHierarchy].[YourMonthLevel] ) ) )




BigChris

I really need to start getting into these cube things...

karthik12345

Thanks Big chris and lynn,

  i attached my  time dimension hierarchy , is the above condition works for this

Thanks,
Karthee

Lynn

Quote from: BigChris on 27 Jan 2016 03:44:29 AM
I really need to start getting into these cube things...

It is mind-bending! I learned a ton here on Cognoise from posts by the lovable Muppet and CognosPaul.

Quote from: karthik12345 on 27 Jan 2016 03:51:23 AM
Thanks Big chris and lynn,

  i attached my  time dimension hierarchy , is the above condition works for this

Thanks,
Karthee

Sorry Karthee, I don't know how to answer your question because I don't understand your hierarchy. What I'd normally expect to see would be a hierarchy that has something like Year > Quarter > Month, perhaps even with days or weeks at the lowest level. Yours appear to be aggregate YTD groupings of some sort. I've not worked with TM1 cubes so I'm not sure if there are nuances there I'm unfamiliar with.

The expression I gave you would find the last member in a particular level and then work backwards to create a set that includes that member along with the three previous members. Since you asked how to get the last four months I assumed you have a date hierarchy with a month level in it. While the expression might work in so far as you get four members back without an error message, that doesn't mean that it satisfies your requirement.


karthik12345

Thanks Lynn,
    Actually my problem is same the hierarchy is different ,i am confused how to get the last four months data by using this hierarchy.
   Tm1  cube is different compare to the normal transformer cubes.

Thanks,
Karthee

sdf

In your Tm1 cube, don't you have any other alias for Month dimension?

karthik12345

Hi,
  I can see some other hierarchy,can  get my requirement by using this. pls find the hierarchy screenshot in attachment.

Thanks,
Karthee   

Lynn

Quote from: karthik12345 on 28 Jan 2016 03:44:32 AM
Hi,
  I can see some other hierarchy,can  get my requirement by using this. pls find the hierarchy screenshot in attachment.

Thanks,
Karthee   

Did you try what I suggested?

MFGF

Quote from: karthik12345 on 28 Jan 2016 03:44:32 AM
Hi,
  I can see some other hierarchy,can  get my requirement by using this. pls find the hierarchy screenshot in attachment.

Thanks,
Karthee   

Does your hierarchy have defined level names? Is there a Month level?

MF.
Meep!

karthik12345

yes, i can see the month levels

@lynn: I tried it showing error,i tried like this  [Cube].[DateDim].[DateHierarchy].[MonthLevel]

Thanks,
  Karthee

MFGF

Quote from: karthik12345 on 28 Jan 2016 04:37:20 AM
yes, i can see the month levels

The attachment you included shows month members, not a month level. Does your hierarchy have defined level names? Do you have a month level you can select from the package tree?

Quote from: karthik12345 on 28 Jan 2016 04:37:20 AM
@lynn: I tried it showing error,i tried like this  [Cube].[DateDim].[DateHierarchy].[MonthLevel]

Thanks,
  Karthee

Are you saying you used [Cube].[DateDim].[DateHierarchy].[MonthLevel] literally in your expression? I think you misunderstood - Lynn's post was indicative of the structure you usually find in a cube. You need to use the actual names for the cube, dimension, hierarchy and level defined in your package.

MF.
Meep!