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

 

How to get previous months data based on the month selected in prompt window

Started by niahanth, 06 Jan 2016 07:05:08 PM

Previous topic - Next topic

niahanth

I have a report in which i need to display results for the previous three months based on the month selected in prompt window. If user selects December the report should show data for November, October and September.

Lynn

Quote from: niahanth on 06 Jan 2016 07:05:08 PM
I have a report in which i need to display results for the previous three months based on the month selected in prompt window. If user selects December the report should show data for November, October and September.

I need to travel from Main Street to Maple Avenue. Can you give me directions? Probably not since I didn't mention what town I'm talking about. The directions could vary dramatically from one town to the next since those street names are very generic and could be found in many different towns.

Take a look at the forum etiquette post for information on how to provide specific information to get the best answers.

In your case it would help to know if you're using a relational or a dimensional package. You don't mention anything about the year. Will the user select from a list of months and separately identify the year or is it assumed to be something based on the month selection? Or will they be selecting from a date control?

niahanth

i have two prompmpths one for year and one for month based on that it need to select previous 3 months data. Its dimensional modelling

MFGF

Quote from: niahanth on 07 Jan 2016 06:47:48 AM
i have two prompmpths one for year and one for month based on that it need to select previous 3 months data. Its dimensional modelling

In that case, you probably need a query calculation in your report that uses the expression:

lastPeriods(3, prevMember([Your Month level from the Date hierarchy] -> ?Your Month parameter?))

MF.
Meep!

niahanth


MFGF

Meep!

BigChris

QuoteQuote from: niahanth on Today at 07:33:03 am
Thanks.. Can i use the same query for relational model??

No.

Beat me to it.  :D

Do you need to create a version for a relational model, or were you asking just out of interest?

niahanth

I have two models one is dimensional and one is relational that need reports to be created base on the month and year selected from the prompt. The data need to be displayed for previous three months. Can you tell me what sql query i need to use for relational model.

Thanks

MFGF

Quote from: niahanth on 07 Jan 2016 08:19:31 AM
I have two models one is dimensional and one is relational that need reports to be created base on the month and year selected from the prompt. The data need to be displayed for previous three months. Can you tell me what sql query i need to use for relational model.

Thanks

Why didn't you explain this when Lynn responded to you originally? It would have saved you a lot of time...

You don't need any SQL. Step away from the SQL dialog! :D

You haven't told us what format the values are you need to filter on. Are they dates? Months? If Months, are they numeric? Numbers but character strings? Month names? Something else? Without these kinds of details it's impossible to tell you how to code your filter expression. Lynn indicated you should include as much detail as possible in your question, but you don't seem to have heeded her advice...

MF.
Meep!