Jump to content
We've recently updated our Privacy Statement, available here ×

JasperServer Domain Design: Derived Table or Calculated Field?


shane_anderson

Recommended Posts

Please excuse me if this is a simple question but I am brand new to this product and have looked for a while and can't seem to find an answer.  I am attempting to design a domain on JS that is connected to an Oracle database and am having issues.

Consider the case where I have three tables as follows:

Dates_Table
JDateGDateStringDate
11500101/01/2015January 1, 2015
11500201/02/2015January 2, 2015
11500301/03/2015January 3, 2015
11500401/04/2015January 4, 2015
11500501/05/2015January 5, 2015
Price_Heading_Table
PriceIDPriceDescCatCode1
100Price Description 1AAA
200Price Description 2AAA
300Price Description 3BBB
400Price Description 4BBB
500Price Description 5CCC
Price_Detail_Table
Price_IDEffective DateAmount
10001/01/20151.25
20001/01/20152.50
20001/03/20152.75
30001/01/20151.15
40001/02/20151.75

 

I wish to create a domain that will allow the creation of an ad-hoc view to return of the following information when a user enters a paramater containing a date value of January 3:

Results for user entering a date of January 3
PriceIDPriceDescGdateAmount
100Price Description 101/03/20151.25
200Price Description 201/03/20152.75
300Price Description 301/03/20151.15
400Price Description 401/03/20151.75
500Price Description 501/03/2015 

My Issue is being able to return only the current effective price for each Price_ID by date.  I can do this using SQL by returning a single row from the Price_Detail_Table when joining by Price_ID where Effectie_Date >= GDate and sorting decending by effective date but I have no idea how to accomplish this in the Domain designer.  I have reviewed the DomEL information (for as much as I am able to find) but have had no luck.

Any idea's would be greatly appreciated!

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I'm not sure if there is a more elegant solution and I would certainly be interested in hearing from anyone who miight have one but I ended up creating a stored procedure to retreive the values I need based on input parameters of PriceID and Date.  I am then able to execute the stored procedure using DomEL in a calculated field.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...