Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 14 Oracle Analytics Lounge
- 210 Oracle Analytics News
- 41 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 77 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
how to build a timestamp function to retrieve data from beginning of fiscal year to current date
Answers
-
Hi Jerry,
Thanks for this. As my prompts were not working and I google it, I found that they work not with union queries and also the error message says exctly that, but good to know they work. Will do more testing.
I am not sure if it is called Bin function, but actually i did so, creating an extra column for channel, market etc.. and created the label 'market', 'channel' etc..
I have been further working on the filter and came out with this which seems to work for now, as I do not have data for last year.
FY YTD="Filters"."Business Date" between CAST('01-MAY-' || CAST(YEAR(TIMESTAMPADD(SQL_TSI_YEAR, case when CURRENT_DATE >= CAST('01-MAY-' || CAST(YEAR(TIMESTAMPADD(SQL_TSI_YEAR, 0,CURRENT_DATE)) AS CHAR) AS DATE) then -0 ELSE -1 END ,CURRENT_DATE)) AS CHAR) AS DATE) and current_date
FY LY YTD= "Filters"."Business Date" between CAST('01-MAY-' || CAST(YEAR(TIMESTAMPADD(SQL_TSI_YEAR, case when CURRENT_DATE >= CAST('01-MAY-' || CAST(YEAR(TIMESTAMPADD(SQL_TSI_YEAR, 0,CURRENT_DATE)) AS CHAR) AS DATE) then -0 ELSE -1 END ,CURRENT_DATE)) AS CHAR) AS DATE) and current_date
Maybe it is not elegant, but it seems to work. I will try your solution though, so i can learn more.
0 -
I'm glad you found something that works, but you should really be working with your data base folks to model a correct time dimension, as Gianni recommended. Then, the analysis you're doing would be a simple exercise . Otherwise, it's an inefficient use of your time, and leaves a maintenance mystery for anyone that has to update or tweak your work.
0 -
+1'000'000 that "logic" gets processed for every single row every single query which runs. Performance, maintenance etc all suffer badly from such "solutions".
0