RSS

OBIEE IS BETWEEN Date Validation for dashboard prompt

21 Apr

Normally when we are working with Calendar date with Between operator we are not seeing any alert message if the user enters the inappropriate dates.
For this we need to some workaround to alert the user for proper dates to input.
To validate date for correct format I have already posted in this blog: https://shivabizint.wordpress.com/2009/04/13/date-validation-for-dash-board-prompt-calendar-control/

Now to alert the user if he is entering inconsistent dates for Between operator we need to add simple code in globalfilterprompt.js.you need to alter this file in two locations

1.\OracleBI\web\app\res\b_mozilla\prompts
2.\OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\b_mozilla\prompts

Steps to do:
Step1: As usual take a backup of your globalfilterprompt.js otherwise you will loss the actual behavior of the prompt if you not done properly.
Step2: Open Globalfilterprompt.js and search for the if (sNewOp == “between”) loop.
And add the following code in this loop after values declaration.

Code snippet:
if(sVal2 < sVal)
{
alert(“Value-2 should be greater than Value-1”);
}

Step3: Now your if (sNewOp == “between”) should be like this

if (sNewOp == “between”)
{
var sVal = tValues[0];
var sVal2 = tValues[1];

// var bVal = (sVal && (sVal != ksDropDownAllChoices) && (sVal != ksEditBoxAllChoices));
// var bVal = (sVal2 && (sVal2 != ksDropDownAllChoices) && (sVal2 != ksEditBoxAllChoices));
if (sVal == ksDropDownAllChoices || sVal == ksEditBoxAllChoices || sVal == ksDropDownNone)
sVal = “”;

if (sVal2 == ksDropDownAllChoices || sVal2 == ksEditBoxAllChoices || sVal2 == ksDropDownNone)
sVal2 = “”;

//Shiva code for BETWEEN Operator//

if(sVal2 < sVal)
{
alert(“Value-2 should be greater than Value-1”);

}
//Shiva code for BETWEEN Operator//

if (!(sVal && sVal2))
{
if (!sVal && sVal2)
tF.sOp = “lessOrEqual”;
else if (sVal && !sVal2)
tF.sOp = “greaterOrEqual”;
else
tF.sOp = “prompted”;
}
}
Step4: Now restart Oracle BI Java Host and Oracle BI Presentation server and also OC4J for better results (I am always doing this).

Now check the Date with between parameter to alert user:

datebetween12

Till next time…

Advertisements
 
12 Comments

Posted by on April 21, 2009 in OBI EE

 

12 responses to “OBIEE IS BETWEEN Date Validation for dashboard prompt

  1. Debarati

    October 20, 2009 at 11:45 am

    Hi,
    The above validation is working only when day entered in prompt 1 is less than that in prompt 2 in the between prompt. If we enter/select dates as 12/03/2009 and 24/01/2009,the validation fails.Please tell us how can we validate this too.Anyways,your blog is extremely helpful and resourceful.Keep it up!

    Thanks and regards,
    Debarati.

     
  2. Debarati

    October 21, 2009 at 5:58 pm

    Hi,

    The above date validation works only when day of selected date 1 is greater than that of date 2 in the between prompt.But if we select date 1 as 14/6/2007 and date 2 as 10/1/2007,the date validation fails to return the alert.Can this too be trapped?

    Thanks and regards,
    Debarati.

     
  3. Debarati

    October 30, 2009 at 5:48 pm

    Hi,

    The above date validation fails when date 1 is 01/04/2009 and date 2 is 31/01/2009 in the between prompt.

    Thanks and regards,
    Debarati.

     
    • Shiva Molabanti

      November 16, 2009 at 4:26 am

      Debarati,

      just Replace this code in above blue highlited:

      if(sVal2 sVal)
      {
      alert(“Value-2 should be greater than Value-1″);
      }

      thanks,
      Shia

       
  4. Debarati

    November 27, 2009 at 6:23 pm

    Hi,

    Thanks for your response.But this is not working.Just to confirm,I have got the code right,do you mean no operator is there between sVal2 and sVal? When I use if(sVal2 > sVal),the code is not doing the required validation as I had mentioned earlier.Any other change/check needs to be done?

    Thanks,
    Debarati.

     
  5. Vinag

    December 7, 2009 at 12:14 pm

    Hi Siva,

    I did the above changes for case insensitive values in Multi-select, but still no use. I have done the changes in gfpmultiselect.js file

    in the C:\OracleBI\web\app\res\b_mozilla\prompts folder

    and

    C:\OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\b_mozilla\prompts folder

    // this.sWhere = this.vColumns[0] + ” LIKE ‘” + sValue + “‘”;
    this.sWhere = this.“UPPER(”+vColumns[0]+”)” + ” LIKE UPPER(’” + sValue + “‘)”;

    After which all the BI services.

    pls let me know if am missing something

    Thanks,
    Vinag

     
  6. Tallapaneni RamaRao Chow Tarak

    June 21, 2011 at 3:27 am

    Hi,
    I have one issue regarding is between” ?
    i want display selected value from prompt which is set to “is between”, obiee 11g

    here i used Presentation variable.
    Formula:
    @{selectweek}{MIN(“Time”.”Fiscal week”)} — it is giving selected value ,but some rows having Min values of the column which is not equal to selected value.

    Min(@{selectweek}{(“Time”.”Fiscal week”)} )— it expression giving error (formula)
    I hope you understand my problem.

    Thanks &Regards,
    Tallapaneni

     
  7. Prad

    August 19, 2011 at 1:55 am

    Hi,

    Can you let me know how the same can be done in OBIEE 11. I am not able to find the above mentioned directories of the javascript files. Thanks

    Regards,
    Prad

     
  8. handwerio

    January 5, 2012 at 5:59 pm

    Im Handwerk gibt es einen neuen Trend: Auftragsbörsen wie My-Hammer. Dort können Interessierte ihre Aufträge einstellen und erhalten Gebote.

    Handwerker mit zu wenig Aufträgen können dann Aufträge entgegennehmen. Danach Bewerimg.

    Wie findet Ihr das?

    Gruesse
    Euer handwerio

     
    • Azmat Hussain

      June 20, 2013 at 11:31 am

      Hello Dear

      OBIEE IS BETWEEN Date Validation for dashboard prompt

      have any solution in OBIEE 11g

      Thanks

      Azmat Hussain

       
  9. Emzee

    February 9, 2014 at 8:28 pm

    Any solutions in OBIEE 11 G for the same is highly appreciated?

     
  10. merllaa

    December 11, 2014 at 8:28 am

    Hi Shiva,

    I need to do this validation in OBIEE 11g, and I couldn’t find where the file is located. Can you share this solution for OBIEE 11g pleas?

    Thanks

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: