Inheritance based on USER column and JPQL based on @ManyToOne column

I wanted to build a simple inheritence scheme for no other reason than to support a generalized table that I could manipulate in standard libraries and to extend that table with columns that might exist in various customer implementations. In the extra-ordinarily simple example that follows I created a base Parcel class; extend that with a ParcelBean which has a column specific to a user; and extend that further with a wrapper class that will include some Trinidad references that I want to keep completely away from the bean classes. In short, I wanted to put together an inheritence scheme for basic OO reasons, not because of any particular table structure.
After some thought I figured that the best way to do this might be to use the Single-Table Strategy, especially after I discovered that I could fool the system by using the Oracle USER pseudo-column for my DiscriminatorColumn and use my schema name for the DiscriminatorValue.
@Entity
@Table(name = "PARCEL")
@Inheritance
@DiscriminatorColumn(name = "USER")
public class Parcel {
  String parcelPin;
  public Parcel() {
  @Id
  @Column(name = "PARCELPIN", nullable = false)
  public String getParcelPin() {
    return parcelPin;
  public void setParcelPin(String parcelPin) {
    this.parcelPin = parcelPin;
@Entity
public class ParcelBean extends Parcel {
  LandUseType luc;
  public ParcelBean() {
  public void setLuc(LandUseType newluc) {
    this.luc = newluc;
  @ManyToOne
  @JoinColumn(name = "LUC")
  public LandUseType getLuc() {
    return luc;
@Entity
@DiscriminatorValue("CPC")
public class ParcelRow extends ParcelBean {
  public ParcelRow() {
  public void doSomething(ActionEvent ae) {
    ; // Trinidad code
}For a couple of weeks this has been working fine. Right up until I tried to a JPQL like the following:
"select p from ParcelRow p where p.luc.cpcCode=12"The problem is that TOPLINK will generate SQL that prefixes USER with an alias (something it does not do if there isn't a foreign key reference involved). This won't work because Oracle SQL does not allow aliases on pseudo-columns
select USER from PARCEL; -- return CPC
select p.USER from PARCEL p; -- throws ORA-01747: invalid user.table.column specificationSo now I'm in a jam. I can't (read won't if you will) give up on my requirement for inheritence. I have multiple clients with the same basic legacy table with minor variations and I have tens of thousands of lines of code that work on the basic core table properties and I don't want to copy and paste. I could use interfaces, except that I would still have to extend the Beans with my Row classes so that I could add the JSF actionListeners (and other such stuff). I need to be able to select Lists of these Row classes with the JSF methods so that I can expose them as values to JSF/Trinidad/ADF Tables and it break every person pattern I enforce to mix JSF and JPA dependencies in the same class.
Anyone out there have any ideas?
Thanks Mark

Of course a simple fix for this problem would be if the Oracle provider code was smart enough to recognize pseudo columns and to not prefix them with an alias.
Is there any chance that this might be done before a final release?
Mark

Similar Messages

  • User Name- and Password-Based Mutual Authentication

    Hi,
    The J2EE 1.4 Tutorial Update 1 shows an example of Client-Certificate Authentication over HTTP/SSL with JAX-RPC, but no User Name- and Password-Based Mutual Authentication example.
    Does this work the same? Does the client need a certificate for User Name- and Password-Based Mutual Authentication?
    I created my own self-signed certificate and imported it using the keytool. When I use my client to connect to my JAX-RPC web service, I get the following error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found.
    It seems that no trusted certificate is found... on the client side?! How do I specify the client certificate at the client side? I created a client certificate and added it to the keystore in the application server...
    If somebody should have an example of User Name- and Password-Based Mutual Authentication, I'd really apreciate it.
    Thanks, d3m0.

    Hi,
    I've almost the same problem.In an application based on Java Web Start, i try to attack a web service through HTTPS. Before the call of the web services, the client have discussed with the server through HTTPS, so the user have already accept the certificate (i use self-signed certificate too), i get the same exception.
    At the begining i've used classes from axis. I've found that axis doesn't want to support non trusted certificate. Some workaround were that the client access the private key of the server ... not really secure. So i've tried to use the JAX-RPC classes, always the exception.
    For the moment , we don't want to use trusted certificate and don't want to install on each user workstation the server certificate. I continue to investigate, if someone have some solution ? What i don't understand is why i've this exception altough i'm in a secure environment (JWS + user accepts the untrusted certificate).
    Sorry, i've never work on User Name- and Password-Based Mutual Authentication, but i think your exception come because of self-signed certificate.
    Regard,
    Pierre.

  • SQL*Loader - How to combine Flat File 3 columns and put into one single column

    Receive a flat file delimited by comma. Want to combine Flat File last 3 columns and put into one single column(Table).
    e.g.
    Flat File
    100,239,30,20,30
    While inserting into table want to combine last 3 columns and insert into invoice number column.
    302030

    It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
    Vijay

  • Compare two columns and formate based on condition

    I know this dead horse has been beaten and I've read my fair share of threads and manuals to no avail..  I have two list that consist of movie titles, holiday movies to be exact.  I'm creating a holiday movie schedule which consist of three(3) columns...A,B and C.  Column A is the Date, Sat, November 17 2012 thru Monday, Dec 24, 2012.  Column C consist of a movie list divided into 2 sections with three subsections each.  Section 1 is animated movies and Section 2 is live action, each subsection, 1.1, 1.2, 1.3, 2.1, 2.2 and 2.3 are lists based on popularity with the kids...low, medium and high respectively.  And finally column B is the movie list relative the column A...the schedule.
    As I write a movie title in column B, I'd like the cell fill to be light red and the corresponding title in column C change to strike through font type.  This way I know I've added the movie title to the schedule...this comes in handy when I ask the kids to help so we have no duplicates in the schedule.  I'm assuming this would take a combination of; Conditional Formatting, cell formulas and perhaps an additional blank column for trigger results.
    I'm including the table, which include an experimental column I was working on.  As an FYI, this has been completed in Excel already, just hoping to get it done in Numbers.
    Thanks for any help anyone can give.
    Date
    Movie Name
    Class
    Sat, Nov 17, 2012
    Animated Christmas Movies
    TRUE
    Lowest Priority Animation
    TRUE
    Frosty Returns
    TRUE
    Sun, Nov 18, 2012
    The Nightmare Before Christmas
    Rudolph and Frosty's Christmas in July
    TRUE
    Rudolph the Red-Nosed Reindeer & the Island of Misfit Toys
    TRUE
    Rudolph's Shiny New Year
    TRUE
    Mon, Nov 19, 2012
    Nothing Like the Holidays
    TRUE
    Medium Priority Animation
    TRUE
    Jack Frost Animation
    TRUE
    Tue, Nov 20, 2012
    Home for the Holidays
    It's Christmas Time Again, Charlie Brown
    TRUE
    Christmas in South Park
    TRUE
    Cartoon Network Christmas Rocks
    TRUE
    Wed, Nov 21, 2012
    Planes, Trains and Automobiles
    Cartoon Network Christmas Yuletide Follies
    TRUE
    Cartoon Network Christmas Vol3
    TRUE
    Twas the Night Before Christmas
    TRUE
    Thu, Nov 22, 2012
    Planes, Trains and Automobiles
    The Little Drummer Boy
    TRUE
    TRUE
    Highest Priority Animation
    TRUE
    Fri, Nov 23, 2012
    Trapped in Paradise
    The Simpson's Christmas
    TRUE
    A Very Special Family Guy Freakin' Christmas
    TRUE
    Family Guy: Road To The North Pole
    TRUE
    Sat, Nov 24, 2012
    American Dad! The Most Adequate Christmas Ever
    TRUE
    A Charlie Brown Christmas
    TRUE
    The Nightmare Before Christmas
    FALSE
    Sun, Nov 25, 2012
    Die Hard
    Frosty the Snowman
    Die Hard 2
    Hooves of Fire
    How the Grinch Stole Christmas
    Mon, Nov 26, 2012
    Gremlins
    Santa Claus is Comin' to Town
    The Year Without a Santa Claus
    Rudolph, the Red-Nosed Reindeer
    Tue, Nov 27, 2012
    The Ice Harvest
    Live Action Christmas Movies
    Lowest Priority
    Wed, Nov 28, 2012
    Reindeer Games
    National Lampoon's Christmas Vacation 2: Cousin Eddie's Island Adventure
    Chasing Christmas
    The Nativity Story
    Thu, Nov 29, 2012
    Bad Santa
    Unaccompanied Minors
    Jingle All the Way
    Jack Frost Live
    Fri, Nov 30, 2012
    The Shop Around the Corner
    The Santa Clause 3: The Escape Clause
    The Santa Clause 2: The Mrs. Clause
    Sat, Dec 1, 2012
    The Bishop's Wife
    Medium Priority
    0
    Bad Santa
    Bad Santa
    Mixed Nuts
    Mixed Nuts
    Sun, Dec 2, 2012
    The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
    Reindeer Games
    Reindeer Games
    The Ice Harvest
    The Ice Harvest
    The Shop Around the Corner
    The Shop Around the Corner
    Mon, Dec 3, 2012
    Miracle on 34th Street B&W
    The Bishop's Wife
    The Bishop's Wife
    Christmas in Connecticut
    Christmas in Connecticut
    The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
    The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
    Tue, Dec 4, 2012
    Mixed Nuts
    Nothing Like the Holidays
    Nothing Like the Holidays
    Home for the Holidays
    Home for the Holidays
    The Family Man
    The Family Man
    Wed, Dec 5, 2012
    Scrooged
    Miracle on 34th Street 1994
    Miracle on 34th Street 1994
    Miracle on 34th Street B&W
    Miracle on 34th Street B&W
    Just Friends
    Just Friends
    Thu, Dec 6, 2012
    Just Friends
    Trapped in Paradise
    Trapped in Paradise
    0
    Highest Priority
    0
    Fri, Dec 7, 2012
    Miracle on 34th Street 1994
    Die Hard
    Die Hard
    Die Hard 2
    Die Hard 2
    Gremlins
    Gremlins
    Sat, Dec 8, 2012

    Hi Stephen,
    Both of these are solvable, and the Date solution cold be similar to that used for the 'stock list' in column C. The Movie Title solution is a different case, though.
    The stock list is edited only occasionally, so requiring the user to unhide column C, add a title, then rehide the column is workable.
    The same is true of the date list, so this too would work with the dates entered into a column that will be hidden, then copied into a visible column with a formula that introduced a detectable difference into the copied version, dependent on the weekday of each date. That difference would be used to trigger the conditional formatting of the cell containing the calculated date as text value. See the example below.
    But the (scheduled) Movie Title column doesn't fit nicely into that mode of operation, as it is edited quite often. As editing, usng the model described, requires making the data column visible, editing the entry (or entries) in that column, then rehiding the column, the hassle factor soon becomes insufferable, if nothing else.
    The first solution I considered (see earlier reply) is workable only if the the formatted table starts and remains the same size in all details (ie. individual row height) as the main table.Any change in row height in the main table not reflected in the auxiliary table immediately destroys the impression of formatting applying to the correct cells. With cells set to wrap text and varying lengths of movie titles, wrapped lines changing the height of individual rows is pretty much unavoidable.
    Best practice here would seem to be to use a separate column to flag the titles already in the "Class" list with a "√" (or flag those not in the list with an "X"), and use conditional formatting to change the background colour of the flagging cell.
    Here's a sample, using "W" to flag the weekend dates in the new column B, and "√" to flag the titles that are on the list already in the new column D.
    I've added two titles to the weekend date, November 18. One is non-existent (as far as I know), so it doesn't appear in the list and doesn't get flagged; the other is chosen from a visible part of the list to show the highlighting of the title in that list. Column "C" (now column "F" due to the insertion of two new columns) is hidden. G, labelled .Class, is the calculated column (D) from the previous message.
    Regards,
    Barry

  • How to show two amount (based on value type and entry code)  in same column

    Hi, I have to show two amount in the same column how can i do that...
    For example there is 
    1) premium amount which depends upon the entry code lets say entry code 1000 = Premium amount .
    2) Now there is another premium amount but this amount is stored on basis of value type ...let us say for value type 'prem' = premium amount .
    these amount are in different field can i shown it in same column in BEx query.
    If you can you please help .

    use the selection criteria to restrict the field types in the query designer- use other variables to check the value
    if it doesnt reconcile- you can alternatively use a multi provider for the same thing- that way you will get the same amount in 1 column and you could restrict using the infoprovider column

  • View link between view based on entity(table) and view based on stored proc

    I've created a view based on a stored procedure. I need to link this view to a view based on an entity which is based on a table.
    I can create the view without issue, but when I attempt to run the application module that contains the relationship I get this error:
    (oracle.jbo.InvalidOperException) JBO-26016: Cannot set user query to view "SalesentityModuleApiView2" because it is a destination in a view link
    One thing that may be notable about this is that this view started out based on a database view. I later overrode the select related methods using the example here:
    http://download-east.oracle.com/docs/html/B25947_01/bcadvvo008.htm
    Any ideas? I will gladly post some code if someone will let me know what might help diagnose this.

    Hi,
    I solved my problem with adding transient field, and changing the value of it (true | false) on set method of field that can be changed so I can get which row was updated. What exactly do you mean when you say not updateable, I'm using a vo with no entity, and I can add, remove rows, in fact I think it's a good solution because I don't want to write to database immediately.

  • SSRS 2008 Fixed assets Report Prior YTD Depreciation column, and Accum Current Book Depreciation column

    I have created Fixed assets Report , but our auditors would like to see separate Prior YTD Depr in separate column and current book Depr in separate column , right now Prior year YTD depr amd Currrent year depr showing in column Amount Curreny column, 
    but I would like to show that amount in net column and Current book depr by each to accum and show in where I have $ 710.95 amount ,  can some one help me how can I change my query to come up what I am looking for,  I really need to fix this for
    our auditors,  and donot to show the details by each month,  any help will be really appreciated,  you guys are so good, I wish I know more about Sql, 
    my Query is below
    SELECT        ASSETTABLE.NAME, ASSETTABLE.ASSETTYPE, ASSETTABLE.QUANTITY, ASSETTABLE.UNITOFMEASURE, ASSETTRANS.TRANSTYPE, ASSETTRANS.ASSETID,
                             ASSETTRANS.TRANSDATE, ASSETTRANS.DIMENSION2_, ASSETTRANS.AMOUNTMST, ASSETTRANS.ASSETGROUP, ASSETTRANS.DATAAREAID,
                             ASSETTABLE.UNITCOST
    FROM            ASSETTABLE INNER JOIN
                             ASSETTRANS ON ASSETTABLE.ASSETID = ASSETTRANS.ASSETID
    WHERE        (ASSETTRANS.DATAAREAID = N'AR1') AND (ASSETTRANS.TRANSDATE >= @Paramfromdate) AND (ASSETTRANS.TRANSDATE <= @Paramtodate)
    thanks in advance

    I don't think I understand exactly what the ask is. What field allows you to distinguish between prior year and current depreciation? TRANSTYPE?
    I think your data is fine. I would suggest using a Matrix instead of a table. Just set the column group to group on the field that distinguishes between current and prior year depreciation. Add all of the rest of your column outside the column group so they
    are only scoped by your row group(s). You can add those columns either before or after your column group columns.
    If you have a lot of work into your report already and don't want to create a new matrix which will require you to recreate the work already done on your table. you can convert the existing table to a matrix as described in this technet wiki article:
    http://social.technet.microsoft.com/wiki/contents/articles/21184.ssrs-converting-between-tablix-controls-matrix-table-list.aspx
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Get Managed Metadata (Taxonomy) ALL Lists with Columns and ALL Choice Lists with Columns VALUES programmatically

    Hi there,
    How to get Managed Metadata Lists  ALL Columns and ALL Choice Lists Columns that are used in the Site Collection programmatically please.
    Regards

    Hi sharepointaju,
    Managed Metadata list is a hidden list, that you can access it through
    http://siteurl/Lists/TaxonomyHiddenList/AllItems.aspx, then it is similar to other lists, you can use server or client code to interate each field in the list, show the the value for each item.
    For all choice list columns, I'm not clear what you mean in this situation, do you mean to get all choice columns in the site collection, if so, iterate site columns, and lists to get list fields, check whether it is a choice type field.
    This may be not your requirement, please provide more information how you want to get which value.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Filtering report data based on user login and Parameter fields

    Post Author: mronquillo
    CA Forum: General
    Hi,I am running a report that filters data based on the user login. To do this, I created a formula called @user that compares the login name (using the CurrentCEUserName field) and returns the user's name. If the user login is not a login specified in the if statements, it returns the parameter field "user_name":For example: if CurrentCEUserName = "loginname1" then "User's Name 1"else if CurrentCEUserName = "loginname2" then "User's Name 2" else if CurrentCEUserName = "loginname3" then "User's Name 3"  else if CurrentCEUserName = "loginname4" then "User's Name 4".. .else {?user_name}   In select expert, I have a condition which filters data based on the string returned from that formula:{Table.Name} = {@user}  This works fine and when the users run the report they only their own data. However, they are still prompted to choose a parameter field regardless if of the value returned by the @user formula. Oddly enough, regardless of what parameter field they choose, they will still only see their own data (i.e. if John chooses "Bob" from the parameter list, he will still only see John's data.)If I remove the "else {?user_name}" line from the @user formula, then the users are not prompted anymore. However, if they are not a "valid" user - that is, if any of the if statements in the formula are not true for their login name - then they will see no data. What I want to do is make the report ONLY prompt the user to choose a parameter field if their login name is not "valid". That is, if the @user formula is able to return a string value for their login name, then they will jump right into the report without being prompted to choose a parameter - otherwise, the user will be prompted to choose a name from the parameter list. I thought my formula would allow this (hence the "else" clause), but it seems that if a parameter field is present in any formula, then the report automatically prompts the user to choose a parameter. Is what I am trying to accomplish possible in CR (I'm using CR v10.0) or is there a better way to do what I am trying to do?Thanks in advance.

    Post Author: sharonmtowler
    CA Forum: General
    try, or something like that
    (if CurrentCEUserName ={?user_name} then true else ({Table.Name} = {@user}) )

  • Default DFF based of user login and value set

    Hi All,
    My requirement is: Default the value of a DFF based on a value set and the person who logs in.
    My value set is:
    Person A - Value 1
    Person B - Value 2
    So, if person 1 logs in - the DFF value should be Value 1.
    If person 2 logs in - the DFF value should be Value 2.
    How can this be achieved?
    Alex

    You can default the value by using SQL in the default type for the particular DFF segments. You can get the user id from $PROFILES$.USER_ID. You can derive the employee id / name from the user id (provided you do indeed tag an employee to the FND User definition)

  • How to create  DynPage based on user parameter and than implement it?

    Hello,
    I've written a Portal Application which contains a Portal Object which is a DynPage.
    I am using NWDS for development and NW 04 Patch 11 as the portal.
    This DynPage process something according to a hardcoded URL. I would like to transform this URL to a parameter which will be received from the user.
    Can someone please explain me the whole process with a simple example that includes:
    1. How to change the code/project to receive parameter from the user?
    2. How to change the iView configuration which is based on this PAR file to send the user parameter.
    3. Where the user should enter it's parameter once all done?
    Thank you.
    Roy

    Hi Roy,
         If i understand your question properly, then you should do the following. This will let you change the value globally for all the users as an iview parameter. If you edit the iview then you will see the property that you have added to portalapp.xml.
    1. Modify your portalapp.xml to accept iview personalization.
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="links_tree">
          <component-config>
            <property name="ClassName" value="com.sap.sen.gcp.km.links.links_tree"/>
            <property name="SecurityZone" value="com.sap.sen.gcp.km.links/high_safety"/>
          </component-config>
          <component-profile>
            <b><property name="url" value="/documents"/></b>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    3. The following code will get you the value of path.
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext myContext = request.getComponentContext();
    IPortalComponentProfile profile = myContext.getProfile();
    <b>String url = profile.getProperty("url");</b>

  • TDMS copy based on Company Code and time based reduction.

    I'm struggling to understand the process of this scenario.
    I created a new client in the target system (using local client copy with SAP_UCSV).
    I configured a time based and company code based reduction.
    After the TDMS copy is complete, I check the target system and still find plenty of data that isn't related to the company codes I selected. It appears that it still copies part of the excluded data. For example: I can still find work orders and sales orders for company codes that I specifically didn't select for the copy process.
    Any idea why this is? It appears that the copy doesn't bring across ALL of the excluded data. Just some.
    I double checked and triple checked my TDMS selection for company code based reduction and I can't find any error in there.
    To be more specific: I selected company code A01 A02 A03 and left B01 B02 B03 out. After the copy there are still orders visible in the target system with company code B01 B02 B03.
    This is after I created an empty target client first so it's not copying into an already existing client.
    Thanks for any guidance guys.

    Hm, not sure what's going on. There is no clear link between those existing orders and the company codes I initially selected. Then again it only seems to have a "high level" record of the data. As soon as one starts to drill down, the data is missing as expected. Same goes for other areas as well.
    Looks like we can live with that for now so I won't lose any sleep over it anymore.

  • Alternate select lists on 2 columns and return more than 1 column

    Hi,
    I try to build 2 alternate select lists and each select list should return more than 1 column
    2 Columns PART_ID and PART_SPECIFICATION
    Now I build a select list on PART_ID like
    select part_id d,part_id r from parts;
    The result should be:
    Column PART_ID has PART_ID and PART_SPECIFICATION must be text of PART_SPECIFICATION
    The other select list based on PART_SPECIFICATION should be like
    select part_specification d,part_id r from parts;
    Now it should be displayed part_specification in PART_SPECIFICATION and part_id in PART_ID.
    This is because one user knows the part_id and another knows only the specification
    Please help me
    Siegwin

    Hi Siegwin,
      Check your application Page 7(copy of page 500)  using select list instead of plugin, it gives all values.
    and works very well,
    use ajax process to get Xml data into page items
    following are changes
    application process: getData
    application item : TEMPORARY_APPLICATION_ITEM
    create one function in page html header pull_multi_value()
    and it call on page item p7_empno on html form element attribute as onchange="pull_multi_value(this.value)";
    this may Helps you,
    Pars.

  • Read an excel sheet and selected two columns like A and C will plot as a XY Graph (X as a A column and Y as a C column)

    hi sir i am read excel sheet using labview ,but unable to plot the selected colomns,so its needfull ,please find any body to sollution to the problem .i i already did some part ,it is take  too much delay
    Attachments:
    CSV File to XY GRAPH 13.lvproj ‏9 KB

    shambhulinga a écrit :
    hi sir i am read excel sheet using labview ,but unable to plot the selected colomns,so its needfull ,please find any body to sollution to the problem .i i already did some part ,it is take  too much delay
    First, you are not reading an Excel sheet but a text file (a csv file is a text file). From the listing of the function used (from the lvproj file) you are using the Read From Spreadsheet function, this function will return a 2D array. Use the Index Array function to extract the x and y value columns. Bundle them (using the Bundle function) and wire the output to your XY-Graph.
    Ben64

  • Displaying columns based on User Input

    Hi,
    I have a following requirement :
    I have four columns in a report : Performance Indicator ,Target (XTD) , Actual (XTD),Indicator(Traffic Lights)
    Based on the prompt, which contains column named as "Review Frequency" having values as 1. Monthly 2. Quaterly 3. Yearly.
    When User select "Monthly" in pormpt I want to see MTD in Actual and Target column and Indicator depending on these columns.
    When User select "Quaterly" in pormpt I want to see QTD in Actual and Target column and Indicator depending on these columns.
    Can anybody tell me how can we achieve this?
    I think I can achieve this with guided navigation but for that I have to create 3 reports.
    Can anybody have any better idea to create just one report and based on user input I can show/hide columns in a single report?
    This is mainly related to Balanced ScoreCard.
    Thanks in advance
    Regards,
    Vikas

    you have seperate columns for monthly, quarterly, and yearly, right?
    In the prompt, save the "Review Frequency" as a Presentation Variable "abc";
    In the request, you add actual (MTD) column, edit the formula, use something like:
    CASE
    WHEN @{abc}='Monthly' THEN "- SalesFacts"."actual (MTD)"
    WHEN @{abc}='Quarterly' THEN "- SalesFacts"."actual (QTD)"
    ELSE "- SalesFacts"."actual (YTD)"
    END
    then do the same thing for target column.

Maybe you are looking for