Skip to Content
avatar image
Former Member

How to get Start Date and End Date from User Responce in Webi

Hi Experts,

I am geting an out put of user responce(.....) in below given format

07/10/2015 12:30:43 AM;07/15/2015 12:30:43 AM

I want to display the start date and end date  as below given format

Date Range : 07/10/2015 To 07/15/2015


Can anyone suggest ???


Note:


I have used the below mentioned code but it is giving me only the Start Date. How do I get the End Date aswell ?


=FormatDate(ToDate(Trim (Substr( UserResponse("Enter To Date");1;Pos(Concatenation(Trim(UserResponse("Enter To Date"));" ");" ")));"MM/dd/yyyy");"MM/dd/yyyy")




Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Oct 15, 2015 at 12:55 PM

    Hallo

    Maybe this post could be of use:

    How to use formulae to change date and time formats in WebIntelligence

    Regards

    Antonette

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 15, 2015 at 12:59 PM

    Hi Babisri,

    The UserResponse() function looks for the Prompt text (e.g. "Enter Start Date" or "Enter End Date" etc) from the prompt screen. Depending on what text you use in UserResponse, it gives you the value that was selected in that prompt. So, in the formula you have entered the same text "Enter To Date:" in both the places, change the first text to "Enter From Date:" or whatever prompt text you're using, that'll do it.

    Updated formula:

    =FormatDate(ToDate(Trim (Substr( UserResponse("Enter From Date");1;Pos(Concatenation(Trim(UserResponse("Enter To Date"));" ");" ")));"MM/dd/yyyy");"MM/dd/yyyy")


    Also, you don't have to use Trim, Substr etc, if the Date object's data type is Date time, use the below formula and you should get the desired result.

    I just tested this and it works perfect for you.

    ="Date Range: "+FormatDate(ToDate(UserResponse("Enter From Date");"");"MM/dd/yyyy")+" To "+FormatDate(ToDate(UserResponse("Enter To Date");"");"MM/dd/yyyy")


    Hope that helps,

    Mahboob Mohammed

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 15, 2015 at 01:02 PM

    Hi,

    try with these steps.replace "Period From/To (in Calendar Days)" text with your prompt text in the formulas.

    From Date=If(Length(UserResponse("Period From/To (in Calendar Days)"))=45) Then Substr(UserResponse("Period From/To (in Calendar Days)");1;10)

    To Date=If(Length(UserResponse("Period From/To (in Calendar Days)"))=45) Then Substr(UserResponse("Period From/To (in Calendar Days)");24;11)

    Final variable=[From Date]+" To  " +  [To Date]

    Amit

    Add comment
    10|10000 characters needed characters exceeded