Skip to Content
author's profile photo Former Member
Former Member

Object in the universe to determine YTD, MTD or daily given a prompted date


I would like to create an object in my universe to determine if I need the figure for YTD calclations, MTD calculations or Daily calculations.

I have got a table DAYS with a column DAY (date type).

The variable would return 'Daily' if the DAYS.DAY is the prompted day. It would return 'MTD' for every DAYS.DAY with the same month as the prompted day and it would return YTD for every else day.

I have tried with CASE clause but I get an error "invalid number"


WHEN @Prompt('Enter values for Production Day:','D',,Mono,Free,Not_Persistent,,User:0) = DAYS.DAY THEN 'Daily'

WHEN TRUNC(@Prompt('Enter values for Production Day:','D',,Mono,Free,Not_Persistent,,User:0),'MONTH') = TRUNC(DAYS.DAY,'MONTH') THEN 'MTD'



Is this a good approach? How can I solve this with an object in the universe?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 23, 2016 at 04:59 PM

    Hi Jonas,

    How about trying this approach from Former Member's blog? You'll have to tweak it a little bit with the table.columns you're using and also the Daily or MTD or YTD text you want to see.


    Let us know.


    Mahboob Mohammed

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.