Return each value only once using cfloop query

Hi,
I have some code that dynamically populates a cfselect list and then populates a second list based on those values. Everything seems to be working fine, except that all values are being pulled from the database, and there are duplicates in most cases. For example, value 1S1W diplays in the drop-down menu 10 times, where I would only like it there once.
Is there a way to have one of each value in my list?
<cfif isDefined('form.select_Main_Group')>
    <cfset page.select_Main_Group = form.select_Main_Group>
</cfif>
<cfoutput>
  <form name="DropDown" method="post">
  <!--- query DB for the first drop down list --->
<CFQUERY name="get_Main_Group" datasource="ds" dbtype="odbc">
SELECT *
          FROM  slco_sire.dbo.area_reference_plats_doc INNER JOIN slco_sire.dbo.area_reference_plats_page
          ON    slco_sire.dbo.area_reference_plats_doc.doc_id = slco_sire.dbo.area_reference_plats_page.doc_id
          ORDER BY page_description
</CFQUERY>
  <!--- first drop down list --->
  <!--- NOTICE the onChange javascript event in the select tag, this is what submits the form after the first selection --->
  <select name="select_Main_Group" required="yes" onchange="this.form.submit()">
     <option>Select Township/Range</option>
     <!--- dynamically populate the first drop down list based on the get_Main_Group query --->
     <!--- NOTICE the CFIF within the option tag, this says, if the first selection has been made, display the chosen option when the page reloads --->
     <cfloop query="get_Main_Group">
         <option value="#SECTION#" <cfif isDefined('form.select_Main_Group')><cfif form.select_Main_Group eq "#SECTION#">selected</cfif></cfif>>#TOWNSHIP_RANGE#</option>
           </cfloop>
</select>
<p>
<!--- if the first selection has been made, display the second drop down list with the appropriate results --->
<cfif isDefined('page.select_Main_Group')>
   <!--- query DB for second drop down list, based on the selected item from the first list --->
   <cfquery name="get_Sub_Group" datasource="ds" dbtype="odbc">
        SELECT TOWNSHIP_RANGE, SECTION
        FROM  slco_sire.dbo.area_reference_plats_doc INNER JOIN slco_sire.dbo.area_reference_plats_page
                    ON    slco_sire.dbo.area_reference_plats_doc.doc_id = slco_sire.dbo.area_reference_plats_page.doc_id
        WHERE SECTION = '#page.select_Main_Group#'
   </cfquery>
   <!--- second drop down list --->
   <select name="select_Sub_Group" required="yes">
      <option>Select Section</option>
      <!--- dynamically populate the second drop down list based on the get_Sub_Group query --->
      <cfloop query="get_Sub_Group">
         <option value="#SECTION#">#SECTION#</option>
      </cfloop>
   </select>
</cfif>
</form>
</cfoutput>

Emily,
OK.  Yes it is possible.  Change your first query to:
SELECT  DISTINCT TOWNSHIP_RANGE
          FROM  slco_sire.dbo.area_reference_plats_doc INNER JOIN slco_sire.dbo.area_reference_plats_page
          ON    slco_sire.dbo.area_reference_plats_doc.doc_id = slco_sire.dbo.area_reference_plats_page.doc_id
          ORDER BY TOWNSHIP_RANGE
</CFQUERY>
Notice I removed any mention of SECTION, because it's irrelevant to generating a unique list of TOWNSHIP_RANGE.  Also, GROUP BY is not needed, but an ORDER BY will sort the records in alphanumeric order.
Then you need to modify your code where you generate the option list for the first pulldown:
<option value="#get_Main_Group.TOWNSHIP_RANGE#" <cfif StrucKeyExists(form,'select_Main_Group') AND form.select_Main_Group eq "#get_Main_Group.TOWNSHIP_RANGE#">selected</cfif>>#get_Main_Group.TOWNSHIP_RANGE#</option>
Here I did a couple of things beside changing SECTION references to TOWNSHIP_RANGE .  It's a good idea to add the query name prefix to column names when you output them so that you avoid collisions with variables that have the same name.  I also reduced your <CFIF> statements to one compound statement for simplicity, and replaced the IsDefined with a StructKeyExists function.  This is considered to be better practice and won't throw an error when used in a compound statement (if you kept the IsDefined statement and tried that in a compound selection, it can sometimes throw errors if the variable in the IsDefined doesn't exist).
Now, your second query should be something like:
<cfquery name="get_Sub_Group" datasource="ds" dbtype="odbc">
        SELECT DISTINCT SECTION
        FROM  slco_sire.dbo.area_reference_plats_doc INNER JOIN slco_sire.dbo.area_reference_plats_page
                    ON    slco_sire.dbo.area_reference_plats_doc.doc_id = slco_sire.dbo.area_reference_plats_page.doc_id
        WHERE TOWNSHIP_RANGE = '#page.select_Main_Group#'
        ORDER BY SECTION
   </cfquery>
Here I changed the WHERE clause to filter based on the TOWNSHIP_RANGE you selected in the first pull-down.  This should now return a list of SECTIONs that match the TOWNSHIP_RANGE selected in the first pull-down.
Lastly, some minor changes to the option list for the second pulldown:
  <option value="#get_Sub_Group.SECTION#">#get_Sub_Group.SECTION#</option>
One other thing I noticed.  If you are on ColdFusion 8 or 9, the dbytpe="odbc" is no longer needed.  I'm assuming you are using an ODBC database connection to something like MS Access.  If so, you can omit the dbytype entirely.  It's only needed now if you do query-of-query queries, where it would be dbtype="query".
HTH,
-Carl V.

Similar Messages

  • How to display field value only once in REUSE_ALV_GRID_DISPLAY

    hi experts,
                   i am using REUSE_ALV_GRID_DISPLAY, for alv outpur display.but i want one of the field in output ,not to display the value which is of same, it have to be displayed only once, I mean i have a number which contains multiple line items corresponding, here i want to display the field value only once when it is repeating , for the same header number, how can i achieve it

    Hi,
    check the sample code,
    REPORT  Z_ALV.
    Database table declaration
    TABLES:
      sflight.
    Typepool declaration
    TYPE-POOLS:
      slis.
    Selection screen elements
    SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS:
      s_carrid FOR sflight-carrid.
    SELECTION-SCREEN END OF BLOCK blk_1.
    Field string to hold sflight data
    DATA:
      BEGIN OF fs_sflight ,
        carrid   TYPE sflight-carrid,      " Carrier Id
        connid   TYPE sflight-connid,      " Connection No
        fldate   TYPE sflight-fldate,      " Flight date
        seatsmax TYPE sflight-seatsmax,    " Maximum seats
        seatsocc TYPE sflight-seatsocc,    " Occupied seats
      END OF fs_sflight.
    Internal table to hold sflight data
    DATA:
      t_sflight LIKE
       STANDARD TABLE
             OF fs_sflight .
    Work variables
    DATA:
      t_fieldcat TYPE  slis_t_fieldcat_alv,
      fs_fieldcat LIKE
             LINE OF t_fieldcat.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM get_data_sflight.            " Getting data for display
      PERFORM create_field_cat.            " Create field catalog
      PERFORM alv_display.
    *&      Form  create_field_cat
          Subroutine to create field catalog
          There is no interface paramete
    FORM create_field_cat .
      PERFORM fill_fieldcat USING   'Carrier Id'    'CARRID'   '2'.
      PERFORM fill_fieldcat USING   'Connection No' 'CONNID'   '1'.
      PERFORM fill_fieldcat USING   'Flight Date'   'FLDATE'   '3'.
      PERFORM fill_fieldcat USING   'Maxm.Seats'    'SEATSMAX' '4'.
      PERFORM fill_fieldcat USING   'Seats Occ'     'SEATSOCC' '5'.
    ENDFORM.                                    "create_field_cat
    *&      Form  fill_fieldcat
          Subroutine to fill data to field column
         -->p_seltext      Column label
         -->p_fieldname    Fieldname of database table
         -->p_col_pos      Column position
    FORM fill_fieldcat  USING
                        p_seltext    LIKE fs_fieldcat-seltext_m
                        p_fieldname  LIKE fs_fieldcat-fieldname
                        p_col_pos    LIKE fs_fieldcat-col_pos.
      fs_fieldcat-seltext_m  = p_seltext.
      fs_fieldcat-fieldname  = p_fieldname.
      fs_fieldcat-col_pos    = p_col_pos.
      APPEND fs_fieldcat TO t_fieldcat.
      CLEAR fs_fieldcat.
    ENDFORM.                    " fill_fieldcat
    *&      Form  get_data_sflight
          Subroutine to fetch data from database table
          There is no interface parameter
    FORM get_data_sflight .
      SELECT carrid
             connid
             fldate
             seatsmax
             seatsocc
        FROM sflight
        INTO TABLE t_sflight
       WHERE carrid IN s_carrid.
    ENDFORM.                    " get_data_sflight
    *&      Form  alv_display
          Subroutine for ALV display
          There is no interface parameter
    FORM alv_display .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          it_fieldcat   = t_fieldcat
        TABLES
          t_outtab      = t_sflight
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " alv_display
    End of code

  • How to set a payload field value only once for multiple instances selected?

    The user needs to set a payload field value and then he can approve the task so the task can continue through the process, that's fine when the user selects one instance and sets the value in the task details section and then clicks the approve button, but how do we achieve the same behavior in a multiple way?, I mean the user can select multiple tasks in the workspace (in this case the details task page is not available and instead the following label appear "Multiple tasks selected") then if the user clicks the Actions drop down -> APPROVE he only gets the message "your request was processed successfully", so how can the user modify the payload field value only once for all the selected tasks so when he clicks APPROVE the value is populated in all the instances selected.
    Thanks,
    Carlos.

    In the action which displays the edit page just set the form idx value before displaying the jsp.

  • How can I ensure a function is called only once in a query?

    I have a function (in a package) that returns the start date and end date to be used by my query. The query was taking bind variables but when I updated it to use the function calls it slowed down a lot.
    I tried creating an inline view that selects the start and end date and joins with the other table but this does not help. I thought the inline view would only be run once but this is not the case. I have my function print out a value from a sequence and i see that it is called thousands of times.
    Why would the procedure call be so much slower?
    How can I ensure that the function is only called once in the query?
    This is what I currently have:
    SELECT col1, col2
    FROM aTable,
    (SELECT proc.getStartdate startDate,
    proc.getEndDate endDate
    FROM dual) dt
    WHERE aTable.theDate >= dt.startDate
    AND aTable.theDate <= dt.endDate
    Thanks

    They get the begining and ending dates to be used by the query.
    My application uses the Oracle Portal. Each user can select their date range and it is stored as a user preference. The portal API provides funcitons for retrieving the preferences and I have encapsulated it in my procedure so the developers do not need knowledge of the portal. If they just restrict their queries to the dates returned by this function they will get the needed data.
    Our work around as been to pass these date variables around as bind variables.

  • To make to consider condition value only once

    Dear Experts,
      could you please tell me how i can make the condtion entry in SO level only once.
    Waht config is required at V/06 in spro.
    Quick response would be of great help
    Regards,
    Siva

    Answered..

  • Returning multiple values at once from listOfValues region

    Friends,
    I've created a region (listOfValues) which has 4 fields/columns
    ResponsibilityName, ResponsibilityId, ApplicationName, ApplicationId
    I assigned ResponsibilityName of the listOfValues to a field Responsibility in a page.
    It works fine when I select a value from this LOV. It returns a value to 'Responsibility' field of the page.
    Is it possible to return other 3 fields as well while selecting ResponsibilityName from LOV. for example while selecting a value for field 'Responsibility' , can the LOV return ResponsibilityId from LOV to field 'ResponsibilityId' in the page, at the same time?
    Can 1 selection returns more than 1 values to fields?

    Nadir,
    I would suggest you have a look of the chapter on LOVs in the dev guide. Just to give you an idea, you map an item in the LOV table to an item on the base page. If you select one value from the LOV table, corresponding values are redirected to the accordingly mapped items on the base page.

  • Display group by field value only once for each group

    I have a table with following fields:
    TicketNo (varchar2)
    TName (varchar2)
    DateIssue (Date/Time)
    I wanto retrieve result in the following form:
    DateIssue TName TicketNo
    01-oct-2006 ABC 123-7733
    DEF 545-54454
    GHI 254-4545
    02-oct-2006 JKL 454-7897
    MNO 444-7878
    TName and TicketNos must be grouped by DateIssue. Since "Group By" clause uses agregate functions only, therefore this type of query will not run:
    SQL> Select DateIssue,TName,TicketNo from Table1 group by DateIssue order by DateIssue;
    How to display the above given result?

    SQL> select * from tickets;
    TICKETNO   TNAME      DATEISSUE                                                
    121-565    abc        04-FEB-07                                                
    454-hj     def        04-FEB-07                                                
    4545-856   gftr       03-FEB-07                                                
    fg45-856   gth        03-FEB-07                                                
    SQL> select decode(row_number() over(partition by to_date(dateissue) order by ticketno),1,dateissue) dateissue
      2         ,tname,ticketno
      3  from tickets;
    DATEISSUE TNAME      TICKETNO                                                  
    03-FEB-07 gftr       4545-856                                                  
              gth        fg45-856                                                  
    04-FEB-07 abc        121-565                                                   
              def        454-hj
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • SCORE(n) returning zero values in an outer join query

    Hello all,
    Is there any way to get a query that contains an outer join to return proper scores. I couldn't find out why this was happening in my query, but I'm getting a score values of 0 on most results.
    Below are queries with result sets. As you can see the results that are scoring in the second query are scoring correctly, but only two have scores.
    - - - Query 1, no outer join - - -
    SELECT DISTINCT SCORE(0) AS scr,
    file_repository.file_id,
    file_repository.file_title
    FROM file_repository
    WHERE CONTAINS(index_url,'SYN(dui,a_thesaurus)', 0) > 0
    ORDER BY scr ASC
    SCR FILE_ID FILE_TITLE
    7 136 Prisoners
    7 240 Drug booklet
    8 64 Communications
    8 146 Rates
    8 168 Vehicle Collisions
    8 206 document4
    14 207 document5
    14 211 document5
    15 74 Diplomatic Personnel
    22 214 documentB
    30 81 DUI and PCA Offences
    - - - Query 2, with outer join - - -
    SELECT DISTINCT SCORE(0) AS scr,
    file_repository.file_id,
    file_repository.file_title
    FROM file_repository, file_security
    WHERE CONTAINS(index_url,'SYN(dui,a_thesaurus)', 0) > 0
    AND file_repository.file_id = file_security.file_id(+)
    AND file_security.auth_id = 0
    ORDER BY scr asc
    SCR FILE_ID FILE_TITLE
    0 74 Diplomatic Personnel
    0 81 DUI and PCA Offences
    0 136 Prisoners
    0 146 Rates
    0 168 Vehicle Collisions
    0 206 document4
    0 207 document5
    0 214 documentB
    0 240 Drug booklet
    8 64 Communications
    14 211 document5
    This is on Oracle 9i using Oracle Text.
    Thanks in advance

    To do this wouldn't you need to know the data in advance? The real source table had 1800 organisations and 8,000,000 transactions.
    I Tried this as well, creating a pl/sql package as follows.
    create or replace PACKAGE stack AS
    TYPE gnt_push_numbers IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
    TYPE gvt_push_varchars IS TABLE OF VARCHAR(1000) INDEX BY PLS_INTEGER;
    gna_push_numbers gnt_push_numbers;
    gva_push_varchars gvt_push_varchars;
    FUNCTION PUSH ( pn_push_var NUMBER, pn_offset NUMBER) RETURN NUMBER DETERMINISTIC;
    FUNCTION PUSH ( pv_push_var VARCHAR, pn_offset NUMBER) RETURN VARCHAR DETERMINISTIC;
    FUNCTION POP_NUM ( pn_offset NUMBER) RETURN NUMBER DETERMINISTIC;
    FUNCTION POP_VAR ( pn_offset NUMBER) RETURN VARCHAR DETERMINISTIC;
    END stack;
    CREATE OR REPLACE
    PACKAGE BODY "STACK" AS
    FUNCTION push(pn_push_var NUMBER, pn_offset NUMBER) RETURN NUMBER deterministic IS
    BEGIN
    gna_push_numbers(pn_offset) := pn_push_var;
    RETURN pn_push_var;
    END push;
    FUNCTION push(pv_push_var VARCHAR, pn_offset NUMBER) RETURN VARCHAR deterministic IS
    BEGIN
    gva_push_varchars(pn_offset) := pv_push_var;
    RETURN pv_push_var;
    END push;
    FUNCTION pop_num(pn_offset NUMBER) RETURN NUMBER deterministic IS
    BEGIN
    RETURN gna_push_numbers(pn_offset);
    END pop_num;
    FUNCTION pop_var(pn_offset NUMBER) RETURN VARCHAR deterministic IS
    BEGIN
    RETURN gva_push_varchars(pn_offset);
    END pop_var;
    END stack;
    Unfortunately it appears to act before the rows are sorted, so will only work in specialised circumstances, in that you have to ensure the rows have been sorted before the function is used.
    SELECT PUSH(COL), POP..(COL)
    FROM ( SELECT etc.
    Luckily the client decided they didn't want to mix their graphs any more so a more classic approach using a base table select for actuals and then a date table select with a sub-query columns for the projection provided a simple solution.

  • DB Adapter Polls each record only once.

    Hi All
    I am using DB adapter Logical delete Polling strategy in BPEL my process. Whenever new record created or updated in DB table, BPEL instance gets kicked off.
    With Logical delete strategy DB Adapter always updates table with read value(given in wizard) after consuming newly created record. Now once newly created record has been processed/consumed by DB Adapter , It will not picked up again If I update the same record. Reason: DB adapter has already marked it as 'Read'. And my Application can not reset the column marked by DB Adapeter .
    Anybody has some other idea to achieve this ?
    thanks
    /Mishit

    Why can't your application update the field again to the un-read value? It is filled initially with a not-read value isn't it? A simple update trigger on the table could do the trick. If not you should create a staging area table, if you want in an other schema, that gets records whenever an insert or update takes place on your application table. Anyway without table triggers on the original table it is not posible. Did you know you can also create a trigger from a staging area schema on a table in an other schema?
    Kind Regards,
    Andre

  • PHP MySql routine....list each state only once

    I have a db with two fields, city and state. I want to list
    the states on a
    page, but of course only want each state to list once. I have
    the recordset
    ready to go. I know this must be dirt simple....if I only
    knew how.
    Help?
    Thanks,
    Mad Dog

    I have the Simulated Nested Region and thought I might be
    able to fool it by
    not having the second column. But no.....
    Your second option (DISTINCT) is probably perfect. I'll try
    it in a while. I
    was going to email you directly but didn't want to be a PITA.
    THANKS!
    MD
    Joe Makowiec wrote:
    > On 09 Oct 2008 in macromedia.dreamweaver, Mad Dog wrote:
    >
    >> I have a db with two fields, city and state. I want
    to list the
    >> states on a page, but of course only want each state
    to list once. I
    >> have the recordset ready to go. I know this must be
    dirt
    >> simple....if I only knew how.
    >
    > You mean that you want something like:
    >
    > STATE
    > City
    > City
    > STATE
    > City
    > ...
    >
    > See if this extension from Tom Muck does it for you:
    >
    >
    http://www.tom-muck.com/extensions/help/simulatednestedregion/
    >
    > OR - do you just want a list of states? If so, then you
    need:
    >
    > SELECT DISTINCT myState
    > FROM myTable
    > ORDER BY myState ASC
    >
    > And, while we're at it, list of states with count:
    >
    > SELECT myState, COUNT(myState) AS stateCount
    > FROM myTable
    > GROUP BY myState
    > ORDER BY myState ASC
    >
    > If not, post back and we'll take care of it.

  • How can i ask the user only once using Vectors?

    What i am trying to do is get an index of a vector.
    I know that i have to use the elementAt(int), but what i want to do is
    make it so only one screen pops up instead of all 4 of them.
    I just want to ask his custID and from there look up the users information from the Vector. I cant get rid of the variables in the public Employee (see Employee Class) or else i will not be able to get the other information (delete a JOptionPane and you will see what i am talking about). Dont worry about the int int the elementAt part. I figured that out already.
    public class Employee {
    // class constants
    // Data fields
    private String custName;
    private String custAddress;
    private double rate;
    private int custID;
    private double steve;
    public Employee(int id, String name, String adress, double ra) {
    custName = name;
    custAddress = adress;
    rate = ra;
    custID = id;
    public String toString() {
    return "Customer ID: "+ custID + "Customer Name : " + custName +
    "Customer Adrress" + custAddress + "rate: $" + rate ;
    public int getBalls(){
    return custID;
    public String getBallsy(){
    return custAddress;
    public double getRate(){
    return rate;
    the other one...
    package bars;
    import javax.swing.JOptionPane;
    import javax.swing.*;
    import java.util.*;
    public class EmployeeApp {
    //methods
    private static int readInt (String prompt){
    String numStr = JOptionPane.showInputDialog(prompt);
    return Integer.parseInt(numStr);
    private static double readDouble (String prompt){
    String numStr = JOptionPane.showInputDialog(prompt);
    return Double.parseDouble(numStr);
    public static void main (String[] args){
    //read and store the payroll data in an employee object
    Vector programmers = new Vector();
    for (int i = 0; i < 1; i++) {
    Employee programmer =
    new Employee(
    readInt("Enter Customer ID: "),
    JOptionPane.showInputDialog("Name: " ),
    JOptionPane.showInputDialog("Address: "),
    readDouble ("Enter hourly rate: ")
    int steve = programmer.getBalls();
    int bob = steve;
    programmers.add(programmer);
    System.out.println("here: " + steve);
    System.out.println(programmers.toString());

    A vector probably isn't your best bet. Try a Map, a TreeMap if you want them in order, otherwise a HashMap. Use new Integer(customerId).
    Map custMap = new HashMap(20);
    custId = readInt("Enter customer ID");
    custIdI = new Integet(custId);
    Employee emp;
    if(custMap.contains(custIdI)) {
        emp = (Employess)custMap.get(custIdI);
        ... old employess
       } else {
        emp = new Employee(....);
        custMap.put(custIdI, emp);
       }If you use a vector you'll have to search it with a look of your own for a matching id.

  • Is it possible to return to Mountain Lion once using Mavericks?

    So I have recently updated to Mavericks on my MacBook Air, but everything has gone wrong!
    I can no longer open Pages documents which I created with Pages 4.3, and when I transfer a file which I created using Page 5 to a friend, they can't open it with Pages 4.3, either!
    I was wondering if there is anyway I can return to Mountain Lion after I have updated to Mavericks?
    Any help is appreciated!

    You can if you had a prior Time Machine backup:
    http://support.apple.com/kb/PH14176
    That said, I'm unsure that reverting to Mountain Lion is necessary.  Your system should still have Pages 4.3 on it (in the "iWork '09" folder in /Applications) and you can still use that if you prefer it.  If you manually deleted it, then going back to Mountain Lion isn't going to give you Pages 4.3 I don't think.  You should still be able to run Pages 4.3 on Mavericks.
    Also, to open a Pages 5.0-created document in Pages 4.3, you should be able to save it as such.  It's not the default format, but you can export to it.

  • Click on a cell in formula doesn't return value, only text. why?

    When doing a simple formula like =c4-c5 in one of my sheets, when i click on the cell, it doesn't return the value, only text.
    What setting do i have enabled/disabled?
    thanks
    hamdog

    HI Hamdog,
    What you are seeing is the formula that is in that cell.
    The setting you have turned on is the first one in the bottom section of the General page of Numbers Preferences. In the English versions, it looks like this:
    With the checkbox unchecked (as mine is), the formula would read:
    =L10-P10
    Column L is labeled "Tips", Column P is labeled "Lenka", Row 10 is labeled "9. 2. 2013"
    To Copy and Paste the result, 462, click (once) on the cell and Copy, then click (once) on the cell where you want to paste the result and go Edit > Paste Values. This should be the seventh item (not including the separator line) in the Edit menu.
    Regards,
    Barry
    Regards,
    Barry

  • Cubeset to only return positive values?

    Yet another cube formula question... In Excel 2010, no powerpivot or olap pivottable extensions, this is a pure Excel project.
    I am building various cubeset, cubemember, and cubevalue formulas to validate an ETL process.
    Question:
    I need to create a cubeset that only returns the members of a cube that have positive values for a specific measure. This cubeset will then be one of several cubesets that gets fed into a cubevalue formula that would otherwise exceed the 255 char limit.
    I can create a cubeset for the overall measure:
    =CUBESET("MyCube","[Measures].[RetailPrice]")
    but haven't found the right syntax for limiting results to only those that have positive values, I think it would be something like:
    =CUBESET("MyCube","FILTER[Measures].[RetailPrice],[Measures].[RetailPrice]>0")
    This syntax actually doesn't return an error, so maybe it is valid syntax... but when I wrap it in a simple cubevalue statement,
    =CUBEVALUE("MyCube", A2)       where A2 is the Cubeset above, or if I also add date range and other filters,
    I get a #Value error, indicating that "the tuple is invalid" per
    http://office.microsoft.com/en-in/excel-help/cubevalue-function-HA010342391.aspx?CTT=5&origin=HA010342384
    I'm still a newbie with the cubeformula syntax and MDX, so I appreciate any suggestions!

    Hi Rohit-
    The cube has a net value of 1220 for the measure I'm trying to calculate (when I don't filter on > or < zero).
    I tried my formula both ways (looking for just positive, and just negative values) and while both work in the standalone cubeset formula, neither return a value when I use it in a cubevalue formula.
    My suspicion, other than a syntax error, is that this may have something to do with me trying to filter on the measure value(s), instead of a dimension- which I think must be possible, but again maybe not with this syntax.
    Let's assume that we had a total of 1280 in retail price, but due to a few returns, we have a few records that show value of -60. If we were looking at profitability, the 1220 is what matters. If we are looking at "dollars exchanged" as a variable expense
    driver of some other measure, then we'd actually want the absolute value of retail price (1280+60 = 1340). I hadn't been able to get the MDX ABS to work, so this was my attempt to grab the positive and negative numbers separately, and then add them to get
    the equivalent of ABS.
    In this case, slicers aren't a desirable option due to how the report is being constructed (I've used slicers in other reports with cubeformulas, but with Excel 2010 I have to have an extra pivot table to get the slicer value, which then has to get fed into my
    cubeform and I'm back at step 1, getting it to work in the cubeformula syntax)
    Thanks!

  • APEX 4.0.1: $v() function doesn't return multiple values for checkbox?

    Hello,
    I have a report that uses apex_item.checkbox(...) to generate checkbox. This report correctly displays a checkbox for each row. The source code generated in the html page is:
    <input type="checkbox" name="f01" value="202" id="P1_CHECKBOX" />
    <input type="checkbox" name="f01" value="220" id="P1_CHECKBOX" />
    <input type="checkbox" name="f01" value="210" id="P1_CHECKBOX" />
    I want to use the javascript function $v() to get the values of the checked checkbox. I thought that this function return the values of all the checked checkbox separated by ':' but I notice that my code alert($v('P1_CHECKBOX')); returns each time only the value of the first checkbox if it is checked.
    It returns '202' if the first checkbox is checked but nothing if only the second checkbox is checked and '202' if the first and second checkbox are checked.

    Hi,
    first of all, $v, $x and $s are suppose to only work for page items and not for tabular form columns or manually generated HTML elements.
    Second, I think your HTML code is not correct, because each of your checkboxes has the same ID. But the ID has to be unique in the browser DOM tree. So the different checkbox elements should actually be named P1_CHECKBOX_1 .. P1_CHECKBOX_3. Just have a look what is actually generated for a real checkbox page item. BTW, I think you shouldn't name these checkbox elements like a page item, because they are actually not page items. I think that could be confusing for other developers.
    Hope that helps
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

Maybe you are looking for

  • Is there a way to change the categories in the Personal Finance Template

    I am trying to use the Personal Finance Template rather than developing one for myself.  Is there a way to change the Cateorgies that are listed in the template?  Those don't work for me!

  • Can't find recently installed Lion on hard drive!

    I downloaded Lion for my MacBook Pro last week because my 2014 TurboTax disc needed at least 10.7.  The machine has been slowing down considerably and so I asked a friend who is an IT guy to help me.  He said defragging might be needed.  I had alread

  • Name and Address operator's packge do not have any values

    Hi All, I am using the Name and Address operator, but I do not have/want the 3rd party vendor's connector/tool/data library to work with my OWB. I developed the map and deployed that map into my target. Package got generated of name NAME_ADDRESS In t

  • How can i do to_nymber on top of to_char?

    Hello For formatting a number column, I am doing the following in my query: select ... to_char(col1,'999,999,999,999,999.999').... This gives me the formatted output in my query. However, this returns a character. How can I do to_number on top of thi

  • How to use a portal jdbc system to delete or insert by IExecution.execute

    hi everyone: I create a jdbc system in portal. Then I use following codes to query a table IQuery query = client.newQuery(); query.execute("SELECT * FROM [Categories]"); It is fine. Now, I wanna do insert or delete operation. I can't use the IQuery o