Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Month 7 Month 8 Month 9 Month 10 Month 11 Month 12
Visits 2 3 5 2 0 1 6 7 1 3 3 1
The report is running my prompt date.
Month 1 = Minimum month/year by Prompt date
Month 2 = add_month (Month1, 1)
Month 3 = add_month (Month1, 2)
...
I would like to have Label 'Month' populate by actual 'MonthYear'.
For example:
If the prompt; 03/2019 to 02/2020
Month 1 = 03/2019 data = will display 'March 2019' or '032019' in the label of the report
Month 2= 04/2019 data = 'April 2019'
I can't do if or case statement: Month 1 in Jan 2019 then 'Jan2019', because the prompt date is different any time/year
Thank you
Make two new Data Items, where your Parameter for your Prompt may be "TheMonthYear"
This assumes the DB you are using has Left and Mid functions.
Data Item AAA ...
Left(?TheMonthYear?,2)
Data Item BBB ...
Mid(?TheMonthYear?,3,4)
You can add a Text, make it a Report Expression of ...
AAA+'/'+BBB
... then add that to your Report.
HTH, Bob
Looking at your label again of ... 03/2019 to 02/2020
You will need ...
Data Item BBB ...
Mid(?TheMonthYear?,4,4)
Quote from: Cognos_Jan2017 on 21 Jan 2020 01:32:22 PM
Make two new Data Items, where your Parameter for your Prompt may be "TheMonthYear"
This assumes the DB you are using has Left and Mid functions.
Data Item AAA ...
Left(?TheMonthYear?,2)
Data Item BBB ...
Mid(?TheMonthYear?,3,4)
You can add a Text, make it a Report Expression of ...
AAA+'/'+BBB
... then add that to your Report.
HTH, Bob
It did not work for replacing LABEL NAME by prompt or I miss understanding?!
I just created the new data items with extract month, and date from [prompt date], but where do I apply it to replace my old label?
Is your prompt result, IE ... 03/2019 to 02/2020 ?
If it is, that is from the parameter you defined. If your define parameter, IE, is ?LMN?
Then write Left(?LMN?,2) as a Data Item in your query. For this example, Left(?LMN?,2) would result as 03.
Do the same with the Mid(?LMN?,4,4) resulting in 2019.
Let me know if that helps. TIA, Bob