Categories
- All Categories
- Oracle Analytics Learning Hub
- 30 Oracle Analytics Sharing Center
- 19 Oracle Analytics Lounge
- 239 Oracle Analytics News
- 45 Oracle Analytics Videos
- 16K Oracle Analytics Forums
- 6.3K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 88 Oracle Analytics Trainings
- 16 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
Getting the previous year from a parameter
I want to show the budget for the previously selected year. I have a parameter "paramYear" that is
SELECT
"Financials - GL Balance Sheet"."Time"."Fiscal Year"
FROM
"Financials - GL Balance Sheet"
WHERE
"Financials - GL Balance Sheet"."Time"."Fiscal Year" = EXTRACT(YEAR FROM CURRENT_DATE)
I want to use this in another parameter named "paramPrevYear" and just subtract 1
I have tried
SELECT
"Financials - GL Balance Sheet"."Time"."Fiscal Year"
FROM
"Financials - GL Balance Sheet"
WHERE
"Financials - GL Balance Sheet"."Time"."Fiscal Year" = (@parameter ("paramYear")('2025')-1
I have also tried
SELECT @parameter ("paramYear")-1 from "Financials - GL Balance Sheet"."GL Balance (LC)"
Lastly I tried creating a calculation using several variations of the paramYear parameter. Everything I tried returns the previous year but when i use it in this filter (along with other variations) i get no results even though the year is working. I have also tried casting it as an integer even though it already is. No luck
FILTER(
FILTER(
"Financials - GL Balance Sheet"."GL Balance (LC)"."Balance Amount"
USING "Financials - GL Balance Sheet"."Time"."Fiscal Period" = @parameter ("paramFiscalPeriod")('Sep-25')
)
USING "Financials - GL Balance Sheet"."Time"."Fiscal Year" = @parameter ("paramPrevYear")(2025)
)
instead of
@parameter ("paramPrevYear")(2025) if I hardcode a year such as 2024 it works great. I even tried creating a calculation PrevYR which is
@parameter("paramYear")-1 . Again, it shows the correct year if I put it in a column but get no results using that calculation like
FILTER(FILTER("Financials - GL Balance Sheet"."GL Balance (LC)"."Balance Amount"USING "Financials - GL Balance Sheet"."Time"."Fiscal Period" = @parameter ("paramFiscalPeriod")('Sep-25'))USING "Financials - GL Balance Sheet"."Time"."Fiscal Year" = PrevYR even if i cast it as integer.
Any thoughts?
Answers
-
CAST should have worked, was it like CAST(@parameter ("paramYear") AS INTEGER) - 1
0 -
Yes. I also tried casting the calculation and anything else I could think of.
0 -
Log an SR, please see if Oracle Support can help. They have a bigger knowledge base and also access to the Product Development Team who can assist to determine if it is supported or not. Thanks
1
