Add actions to an existing query or function in Power Query

Hello
I have just started using Power Query and can see this will be an amazing tool to add to my tool set. However I am rather slow on the uptake and am having trouble with some of the basics of using Power Query
I have successful created some queries and by following along on some articles at excelguru.ca/blog i have created a usable function or two
The issue i have and can see this being something i will do a lot in the near future (especially while still learning), is that I need to go back to the query and function and edit it. In particular i need to either rename some columns to make them compatible
with other data sources, or delete them.
I can see that i can manually edit the query / function in the advanced editor, but i was wondering if it is possible to open the report up again and edit the columns in the same manner as when creating them in the first place?
Thanks in advance for any help given.
I am using Excel 2010, although do have access to Excel 2013 if needed, but as i am using PowerPivot in 2010 i would prefer to use PQ in 2010 also.
Proportal

OK - What had completely stumped me, and i had to set it aside to do other things, has just been solved!
To explain - obviously editing Queries is simple - right click the query and edit... and then make the changes you want.
For functions - the thing i was really struggling with is also fairly simple, but takes a few more steps.
1 - copy the query from the advanced editor
2 - create a new blank query from Get External Data on the Home Tab / From Other Sources / Blank Query
3 - Past your function in and remove the function statement(s) and reinstate and file path information
4 - Edit the columns etc as you want.
5 - when completed paste the relevent sections back into the original function.
Done.
Hope this helps any others out there that were struggling with something so simple... 
Moral of this - copy and save all your queries and functions in a text editor such as notepad++ so you can cut out a lot of the steps above...

Similar Messages

  • Dcount function in power query

    Hi,
    I have a query generated in power query
    that gives me the following results:
    ID          VALUES             
    1              A001
    2              A002
    3              A001
    4              B001
    5              B002
    6              B001
    I need to insert a new calculated field
    in the query I of the order of
    repetition of each record. The result we
    want to achieve is the following:
    ID          VALUES       RESULT 
    1              A001             1
    2              A002             1
    3              A001             2
    4              B001             1
    5              B002             1
    6              B001             2
    Using access get it using the following
    calculated field in a query: " DCont("*";"tabla1";"Valor='" & [valor] & "'and Id_prueba<=" & [id_prueba])".
    How I can do the same with
    power query?
    Thank you very much in advance and Merry Christmas
    to all,
    José Luis

    Hi,
    You can can use Table.Group and  Table.AddIndexColumn function to solve this.
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        Group = Table.Group(Source, {"VALUES"}, {{"Group", each Table.AddIndexColumn( Table.Sort(_, {"ID", 0 } ) , "RESULT" ,1,1 ), type table}}),
        Final = Table.Sort( Table.Combine( Group[Group] ) , { "ID", 0 } )
    in
        Final
    Regards,
    Hi,
    First thank you very much
    for your answer. Could you please tell me
    where I have to enter the code
    you indicate in your response ?, the
    query´s code where I need to create the
    RESULT field is as follows:
    let
        Origen = Xml.Tables(Web.Contents("http://localhost:xxxx/planning_units/1001/schedule/2014-09-29.xml?end_date=2015-12-31&level=schedule&auth=xxxxxxxxxxxxxxxx=")),
        #"Tipo cambiado" = Table.TransformColumnTypes(Origen,{{"Attribute:type", type text}}),
        #"Expandir schedule" = Table.ExpandTableColumn(#"Tipo cambiado", "schedule", {"activity-id", "booking-date", "employee-id"}, {"schedule.activity-id",
    "schedule.booking-date", "schedule.employee-id"}),
        #"Expandir schedule.activity-id" = Table.ExpandTableColumn(#"Expandir schedule", "schedule.activity-id", {"Element:Text"}, {"schedule.activity-id.Element:Text"}),
        #"Expandir schedule.booking-date" = Table.ExpandTableColumn(#"Expandir schedule.activity-id", "schedule.booking-date", {"Element:Text"}, {"schedule.booking-date.Element:Text"}),
        #"Expandir schedule.employee-id" = Table.ExpandTableColumn(#"Expandir schedule.booking-date", "schedule.employee-id", {"Element:Text"}, {"schedule.employee-id.Element:Text"}),
        #"Índice agregado" = Table.AddIndexColumn(#"Expandir schedule.employee-id", "Índice", 1, 1),
        #"Columnas reordenadas" = Table.ReorderColumns(#"Índice agregado",{"Índice", "schedule.activity-id.Element:Text", "schedule.booking-date.Element:Text",
    "schedule.employee-id.Element:Text", "Attribute:type"}),
        #"Columnas con nombre cambiado" = Table.RenameColumns(#"Columnas reordenadas",{{"Índice", "ID"}}),
        #"Columnas quitadas" = Table.RemoveColumns(#"Columnas con nombre cambiado",{"Attribute:type"}),
        #"Columnas reordenadas1" = Table.ReorderColumns(#"Columnas quitadas",{"ID", "schedule.booking-date.Element:Text", "schedule.activity-id.Element:Text",
    "schedule.employee-id.Element:Text"}),
        #"Personalizada agregada" = Table.AddColumn(#"Columnas reordenadas1", "VALUE", each [#"schedule.booking-date.Element:Text"]&[#"schedule.activity-id.Element:Text"]&[#"schedule.employee-id.Element:Text"])
    in
        #"Personalizada agregada
    Thank you very much in advance,
    José Luis

  • 'Merge' function in Power Query

    A bit of background-
    I have 3 .txt files that I would like to combine into one table in Excel using Power Query. Two of the files contain the same kind of data, and the third contains geographic data I'd like to add on. The first two files I mentioned have an 'ID number' column
    that is also contained in the third file (with geographic data). My goal is to append the first two files, and then use a merge to add geographic fields to the data, matching up based on common ID numbers.
    The first file is about 10000 rows, the second is about 6000. The files are not very big, however when I try to expand the columns in the merge, it says that Excel has loaded several Gbs from the file I'm trying to merge with, when the file is only about
    16 mb.
    Anyone have any ideas how this merge could cause all this 'data' to be loaded, never allowing it to be completed?

    Hi,
    Thanks for your feedback. One way that you could approach this scenario is by importing the three files using "From File -> From Text" in Power Query, then use "Append" to get a new query that appends the first two queries, and finally do a Merge
    operation between the result of Append and the third file.
    If you are indeed doing this and still hitting the issue, you can send us more details via "send a frown" and selecting "include formulas", which will give us more information to help you debug the issue.
    Thanks,
    M.

  • What's Preventing Query Folding in this Power Query?

    I've watched the Power Query presentation at the 2014 Tech Ed, and I'm trying to understand why this PQ (below) doesn't employ query folding.  The Tech Ed Power Point presentation states suggests that "Internal Power Query logic" affects folding,
    but I'm unclear what that means.  Are the Text functions inhibiting query folding?  If so, how might I "scrub" arguments in a custom function parameter list while still encouraging query folding?
    let
    Source = Teradata.Database("fsltdprd.am.freescale.net"),
    Product = Source{[Schema="EDW",Item="PROD_PDM_EFF_CURR"]}[Data],
    Prodline = Source{[Schema="EDW",Item="PROD_LN_PDM_DOC"]}[Data],
    ProdFilter = Table.SelectRows(Product,
    each [MTRL_TYPE_CD] = Text.Upper(Text.Trim("AA"))
    and Date.From([REVSN_RLSE_DTTM]) >= #date(2014,1,1)),
    PrdlFilter = Table.SelectRows(Prodline,
    each [TM_VAR_STS_FLG] = "A"
    and [EFF_TO_DT] = #date(3999,12,31)
    and Text.StartsWith([PTI_CD],Text.Upper(Text.Trim("J")))),
    ProdCols = Table.SelectColumns(ProdFilter,
    {"PART_ID","MTRL_TYPE_CD","PLC_CD","PAO_CD","REVSN_RLSE_DTTM","PROD_LN_ID"}),
    PrdlCols = Table.SelectColumns(PrdlFilter, {"DOC_ID","PTI_CD","PKG_CD"}),
    Join1 = Table.Join(ProdCols, {"PROD_LN_ID"}, PrdlCols, {"DOC_ID"}, JoinKind.Inner),
    Results = Table.RemoveColumns(Join1, {"DOC_ID"})
    in
    Results

    Btw, this is the "finished" product ... 
    (optional #"Pti 1 thru 4" as text
    , optional #"Mtrl Type" as text
    , optional #"Last Revision Dttm" as datetime) =>
    let
    Source = Teradata.Database("fsltdprd.am.freescale.net"),
    MtrlType = Text.Upper(Text.Trim(#"Mtrl Type")),
    PtiCode = Text.Upper(Text.Trim(#"Pti 1 thru 4")),
    LRevDttm = #"Last Revision Dttm",
    Product = Source{[Schema="EDW",Item="PROD_PDM_EFF_CURR"]}[Data],
    Prodline = Source{[Schema="EDW",Item="PROD_LN_PDM_DOC"]}[Data],
    ProdFilter = Table.SelectRows(Product,
    each (if MtrlType = null then true else [MTRL_TYPE_CD] = MtrlType )
    and (if LRevDttm = null then true else [REVSN_RLSE_DTTM] >= LRevDttm )),
    PrdlFilter = Table.SelectRows(Prodline,
    each [TM_VAR_STS_FLG] = "A"
    and [EFF_TO_DT] = #date(3999,12,31)
    and (if PtiCode = null then true else Text.StartsWith([PTI_CD], PtiCode ))),
    ProdCols = Table.SelectColumns(ProdFilter,
    {"PART_ID","MTRL_TYPE_CD","PLC_CD","PAO_CD","REVSN_RLSE_DTTM","PROD_LN_ID"}),
    PrdlCols = Table.SelectColumns(PrdlFilter, {"DOC_ID","PTI_CD","PKG_CD"}),
    Join1 = Table.Join(ProdCols, {"PROD_LN_ID"}, PrdlCols, {"DOC_ID"}, JoinKind.Inner),
    Results = Table.RemoveColumns(Join1, {"DOC_ID"})
    in
    Results

  • Pivot Function in Power Query

    Hi all,
    One thing i'm struggling with is the use of the pivot function to pivot a column within PQ.  I'm confused on why this happens and why I can't clear it up...but here goes:
    I unpivot a set of columns which then gives me two columns (Attribute/Value).  I do this because I have repeated columns of data, but it should all fall under one column (think Hours, Hours1, Hours2, etc) - basically the input is coming from a form
    that has repeating fields but everything is the same data type.
    I make some adjustments to the Attribute columns (Replace items within the Attribute column) then Pivot the two columns again...theoretically I would be able to do this since i just unpivoted the same data, but:
    I get tons of errors (usually "There were too many elements in the enumeration to complete the operation".).  I'm not entirely sure why this happens and it doesn't seem to make sense to me that I can't UnPivot and Pivot and get the same results
    as I originally had.  
    Any recommendations would be greatly appreciated!
    EDIT: I'm choosing "don't aggregate" during the Pivot operation...I get values if I keep some sort of aggregate function, but not the right values (I get a count of the fields instead of the data within the fields)

    Try this solution:
    Once you are to step 3, add an index column that starts at 0 and another index column that starts at 1. 
    Transform by Pivot Column using the names in Attribute to create new columns and the Values Column set to Value.  Under advanced options select Don't Aggregate. 
    Fill Down the Date column
    Filter rows to remove null from Work Time. 
    Here's the M code from the advanced editor: 
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
        #"Added Index1" = Table.AddIndexColumn(#"Added Index", "Index.1", 1, 1),
        #"Pivoted Column" = Table.Pivot(#"Added Index1", List.Distinct(#"Added Index1"[Attribute]), "Attribute", "Value"),
        #"Filled Down" = Table.FillDown(#"Pivoted Column",{"Date"}),
        #"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Work Time] <> null)),
        #"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Work Time", type time}})
    in
        #"Changed Type"
    If that doesn't work, this example might do the trick:
    http://www.excelguru.ca/blog/2015/01/07/transpose-stacked-tables/

  • Power Query filters based on UserID

    I have a sales dashboard built with Power Query, Power Pivot, Power View and Power Maps that I need to filter based on the user that opens the dashboard. Users in ABCD territory, should see sales data for ABCD sales, but should not see sales from ZYXW territory.
    We do this all the time in SSRS using User!UserID as a parameter passed into a stored procedure, but I am not familiar with what function within Power Query would pass the user ID as a parameter into the stored procedure.
    Any help would be greatly appreciated.

    I have solved this limitation by automatically producing one file per user on the dashbord. This also reduce the amount of data per user so the response is fast.
    In the database MS SQL there are a number of "temporary" tables which are sources to the Power Pivot
    database. Those tables are loaded with subsets of data per user and the database is refresh and published
    on the dashbord (Power View). The tables are loaded by stored procedures with the users ID as parameter. Programmed with VBA. No SharePoint in this case.
    Gosta Munktell

  • Can't get my head around Power Query Append

    I have 1 spreadsheet with 6 almost identical tabs. I have added each one to PowerQuery and pre-processed it.  The result of these 6 queries are 6 identical tables.  Now I want to combine them into a single table an import into my data model.
    I see there are 2 approaches but neither are intuitive to me. I just want a single query that I select "import to data model" that will append all the data from the other 6 queries.
    Can someone give me a step by step guide?  All the sites I have looked at tell me how to combine 2 queries but I can't seem to scale the concept.
    I realise this seems like a really dumb question - sorry in advance.
    With hind site, I think I could use this approach 
    datapigtechnologies.com/blog/index.php/using-power-query-to-combine-data-from-multiple-excel-files-into-one-table/
       I will probably do that anyway.
    But I would still appreciate some guidance on the best way to append my 6 tables into 1.

    Hi Mally,
    Thanks for the feedback. Besides typing in the formula as Chris, Curt and Faisal mentioned, you could also apply Append Queries operations to append tables one by one. Note that if you launch "Append Queries" from the Power Query ribbon tab you will get
    a new query every time, but if you do it from the Query Editor dialog ribbon, Power Query adds every Append operation as a new step within the current query.
    We are well aware that this 1-by-1 append operation is a shortcoming in the Power Query UX and have plans to address it by letting users add more than one query (i.e. more than one dropdown) in the Append Queries dialog, which will effectively generate a
    similar formula to what others on this thread have proposed.
    We still don't have details on the timeline for the availability of this improvement to Append Queries, but I wanted to let you know that we are planning to address it.
    Thanks for your feedback and for using Power Query.
    Regards,
    M.

  • Suppress Power Query's Native Database Query Warning

    Is there a way to suppress the "Native Database Query" warning issued by Power Query when running a SQL query directly against a Teradata database?  This warning states, "You are about to run a native database query.  Native queries
    can make changes to the database.  Would you like to run the following query?"

    If we never prompted here, then I could send you a workbook with the embedded query "drop table foo". You'd open it, Power Query would run analysis and we'd execute the statement -- all before you had any idea what had happened. It's true that
    there are many potential users for whom showing the SQL text isn't useful. Hopefully, those users don't have the kinds of server permission that would let a query run with their credentials do lasting damage. But the prompt is to deal with the very possible
    risk of having even a sophisticated user run a query by accident that they shouldn't have.
    The original intent of the feature was to support a scenario where a user says "I already have a SQL query whose output I want to consume into Power Query; why can't I just use that?" It did not take parameterization into account. We subsequently
    considered adding parameterization to this method, but didn't feel that we could sufficiently guarantee security. That is, if your query text is Sql.Database("server", "database", [Query="exec @sql", Parameters=[sql="drop
    table foo"]], the user would be prompted only with "exec @sql" and the malicious payload would be delivered invisibly.
    We very much do not want to have the responsibility of parsing multiple different dialects of SQL to try to guess whether or not it contains potentially-malicious code.
    Our current thinking on this is that we might let advanced users write "trusted code" which has to go through a separate verification step. Code of this type might be able to generate SQL statements without a user prompt. So a workbook might have
    a dependency on the "My Trusted Code" module, and simply won't run if that module hasn't been installed on the local machine. The user would then need a trustworthy (but convenient) way to obtain that module from a trustworthy source.

  • How to pass parameters to query-database function [Solved]

    Dear All,
    I'm working on a BPEL process which reads a file and the data is passes on
    to a web service. In the transform activity to transform data from the source to the
    web serivice parameters, I want to use the query-database function to check if
    the value given in the file exists in the database. I have added a 'If' XSL construct
    for this. Now when the query is static (given with hardcoded where clause), the
    query-database function works fine. But I want to use one of the column in the
    source variable in the SQL query I'm using in the query-database function.
    i.e. If I give the query as below it is working:
    <xsl:if test="orcl:query-database("select empno from emp
    where empno='10'",.....) > 0">
    I want to replace the hardcoded value 10 with the value from the source variable.
    I'm not sure how this should be done. If I refer to the element directly in the XSL
    it is not working. I've shown this below.
    <xsl:if test="orcl:query-database("select empno from emp
    where empno='/tns:Root-Element/tns:Data/:tns:Empno'",.....) > 0">
    Something like above does not work. I'm not sure also if the syntax is correct. It
    does not give any error, but the transformation does not happen.
    Is there any way you can pass any input value as a parameter to the
    query-database function?
    Thanks in advance
    -Ruban

    Hi Dipal,
    The concat works! Thank you very much for the help. I didn't try concat before.
    I was using a alphanumeric field, so it was required to add one more concat
    for enclosing the value with single quotes. For numerical fields, one concat would
    be enough as you had shown.
    My xsl looks like this now:
    <xsl:if test="orcl:query-database(concat(concat("select empno from emp
    where empno='",/tns:Root-Element/tns:Data/:tns:Empno),"'"),
    false(),false(),"jdbc/DbConnection") > 0">
    This works properly.
    Regards,
    -Ruban

  • How to add blank page to existing Document In Adobe Dc

    how to add blank page to existing Document In Adobe Dc Pro

    Hi thashrifs16749461,
    You can add a blank page using Adobe Acrobat DC by following the below instructions :-
    1) Open your existing pdf document in Acrobat DC.
    2) Choose the 'Organize Page' option form the Tools pane on the right as shown below in the screen shoot.
    3) Now at the top you will see all the tools to Organize the page, Click on 'Insert' & select 'Blank Page' from the drop-down to insert blank pages.
    *Shortcut : If you are using windows computer you can use ' Shift+Ctrl+T ' key to insert blank pages.
    In case if you experience any issue or have any query please let us know. We will be happy to help you.
    Regards,
    Aadesh

  • The internal hard drive on my early 2009 24" iMac is nearly full.  How do I add an external drive so that it functions just like the internal drive on the iMac?

    The internal hard drive on my early 2009 24" iMac is nearly full.  I have already worked to free as much space on the HD as possible.  How do I add an external HD and have the iMac read it as though it was part of the internal HD.  I know about external HD for additional storage and I do have an external HD, but, it is so much easier to search the drive when it is internal than having to perform a search on the internal drive and then a search on the external drives.  And, it is easier to save files to an internal drive so that I don't have to decide which external drive to use to save files.  In other words, I want to add an external HD and have it function as though I had purchased a larger internal HD.

    That is simply not possible. Every drive is a separate device. It cannot be used to extend an internal drive as though you had a seamlessly larger drive.
    What you can do is to create a striped RAID array using the internal drive and an external drive. However, doing this will erase the internal drive and you will lose everything on the internal drive. Furthermore, installing Lion or Mountain Lion becomes a bit of a problem because you cannot create a Recovery HD on a RAID and this tends to make the installer choke. However, you can clone an existing Lion or Mountain Lion system to the RAID and designate the RAID as a startup volume.
    I would not recommend the RAID solution, personally, but there are many who do. I prefer the basic solution of spending the money on a larger internal hard drive instead of an external hard drive.
    RAID Basics
    For basic definitions and discussion of what a RAID is and the different types of RAIDs see RAIDs.  Additional discussions plus advantages and disadvantages of RAIDs and different RAID arrays see:
    RAID Tutorial;
    RAID Array and Server: Hardware and Service Comparison.
    Hardware or Software RAID?
    RAID Hardware Vs RAID Software - What is your best option?
    RAID is a method of combining multiple disk drives into a single entity in order to improve the overall performance and reliability of your system. The different options for combining the disks are referred to as RAID levels. There are several different levels of RAID available depending on the needs of your system. One of the options available to you is whether you should use a Hardware RAID solution or a Software RAID solution.
    RAID Hardware is always a disk controller to which you can cable up the disk drives. RAID Software is a set of kernel modules coupled together with management utilities that implement RAID in Software and require no additional hardware.
    Pros and cons. Software RAID is more flexible than Hardware RAID. Software RAID is also considerably less expensive. On the other hand, a Software RAID system requires more CPU cycles and power to run well than a comparable Hardware RAID System. Also, because Software RAID operates on a partition by partition basis where a number of individual disk partitions are grouped together as opposed to Hardware RAID systems which generally group together entire disk drives, Software RAID tends be slightly more complicated to run. This is because it has more available configurations and options. An added benefit to the slightly more expensive Hardware RAID solution is that many Hardware RAID systems incorporate features that are specialized for optimizing the performance of your system.
    For more detailed information on the differences between Software RAID and Hardware RAID you may want to read: Hardware RAID vs. Software RAID: Which Implementation is Best for my Application?

  • Column order in SQL Query (PL/SQL function returning a query)

    Hi,
    when I define a PL/SQL function returning a query inside a region, I often find that the column order is arbitrarily changed.
    How do I enforce the column order ?
    Bye,
    Flavio

    I removed the 11th column called service_name from this dynamic query: and now the report says: report error:
    ORA-01403: no data found. I messed around with the Headiuns Type. It was set to Custom. I changed it to Column Names. There is no difference.
    I am not sure how to fix?
    declare topqry varchar2(32000);
    whereqry varchar2(32000);
    finalqry varchar2(32000);
    var_status varchar2(100);
    division_status varchar2(50);
    office_status varchar2(1000);
    user_status varchar2(1000);
    overdue_status varchar2(1000);
    begin
    if :P10_FALLBACK = 'All' then
    var_status:= ' and vp.status in (''FA'',''FBA'',''FBI'',''25%'',''50%'',''90%'',''Closed'') ';
    elsif :P10_FALLBACK = 'Active' then
    var_status:= ' and vp.status in (''FA'',''25%'',''50%'',''90%'',''FBA'') ';
    elsif :P10_FALLBACK = 'FB' then
    var_status:= ' and vp.status in (''FBA'',''FBI'') ';
    elsif :P10_FALLBACK = 'Closed' then
    var_status:= ' and vp.status in (''Closed'') ';
    elsif :P10_FALLBACK = 'Inactive' then
    var_status:= ' and vp.status in (''FBI'') ';
    end if;
    if :P10_DIVISION = 'All' then
    division_status:= ' and vp.vms_division in (''News'',''Ad Services'') ';
    elsif :P10_DIVISION = 'News' then
    division_status:= ' and vp.vms_division in (''News'') ';
    elsif :P10_DIVISION = 'Ad' then
    division_status:= ' and vp.vms_division in (''Ad Services'') ';
    end if;
    if :P10_OFFICE = '%' then
    office_status:= ' and OFFICE_ID in (select office
    from VMS_OFFICE_ACCESS
    where user_id = lower(:P0_user) ) ';
    else
    office_status:= ' and OFFICE_ID in :P10_OFFICE ';
    end if;
    if :P10_LIMIT_USER = '%' then
    user_status := ' and SALESPERSON in (select first_name || '' '' || last_name
    from VMS_PROSPECT_users u
    join vms_office_access o
    on u.office_id = OFFICE
    where o.user_id = lower(:P0_USER) ) ';
    else
    user_status:= ' and SALESPERSON in (:P10_LIMIT_USER ) ';
    end if;
    if :P10_SHOW_OVERDUE = 'Show' then
    overdue_status:= ' and target_close_date <= sysdate ';
    var_status:= ' and vp.status in (''25%'',''50%'',''90%'',''FBA'') ';
    else
    overdue_status:= ' and FIRST_APPOINTMENT between
    nvl(to_date(:P10_FIRST_APPT_START, ''mm/dd/yyyy''),FIRST_APPOINTMENT) and
    nvl(to_date(:P10_FIRST_APPT_END,''mm/dd/yyyy''),FIRST_APPOINTMENT) ';
    end if;
    topqry := 'SELECT OFFICE_ID ,vp.PROSPECT_ID ,ENTRY_DATE ,ACCOUNT , NEXT_CONTACT_DATE ,ACTION_STEP ,
    TARGET_CLOSE_DATE ,vp.STATUS ,SALESPERSON ,vp.SALES_TYPE ,service_name , FIRST_APPOINTMENT ,MODIFY_DATE ,EST_ANNUAL_REVENUE ,EST_INCREMENTAL_REVENUE ,
    pi.NOTES , pi.SALES_TYPE ,pi.STATUS ,Contact ,Origin_Source FROM VMS_PROSPECTING_ITEMS pi right outer join VMS_PROSPECTS vp on vp.PROSPECT_ID = pi.PROSPECT_ID left outer join VMS_SERVICES vs on vs.service_ID = pi.service_ID where 1 = 1 ';
    whereqry := ' and (not exists (select *
    from VMS_PROSPECTING_ITEMS i3
    where vp.prospect_id = i3.prospect_id)
    or exists (select *
    from VMS_PROSPECTING_ITEMS i2
    where i2.order_id = pi.order_id
    and active = ''Y'' )) and instr(upper(ACCOUNT),upper(nvl(:P10_ACCOUNT,ACCOUNT))) > 0 ';
    whereqry := whereqry || var_status || division_status || office_status || user_status || overdue_status;
    finalqry := topqry || whereqry;
    return finalqry ;
    end;

  • Add action in a popup problem

    Hello,
    I want to add custom action when i click on my 'Yes' or 'No'.
    This the code i used to create my and add actions to it.
    lo_api_component  = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
      lo_window         = lo_window_manager->create_window(
                         window_name            = 'POPUP_WIND'
                         title                  = 'Microsoft Internet Explorer'
                       close_in_any_case      = abap_true
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                         close_button           = abap_true
                         button_kind            = if_wd_window=>CO_BUTTONS_YESNO
                         message_type           = if_wd_window=>CO_MSG_TYPE_QUESTION
                         default_button         = if_wd_window=>CO_BUTTON_NO
      lr_view_controller = wd_this->wd_get_api( ).
      lo_window->subscribe_to_button_event( button = if_wd_window=>CO_BUTTON_YES button_text = 'Yes'
                                            action_name = 'SUBMIT' action_view = lr_view_controller ).
      lo_window->subscribe_to_button_event( button = if_wd_window=>CO_BUTTON_NO button_text = 'NO'
                                            action_name = 'Cancel' action_view = lr_view_controller ).
      lo_window->open( ).
    In my view that calls the popup i have created the action submit and cnacel.
    But when i run the WDA i get this message:  Action &OBJECT_ID& does not exist
    Does any one have a clue?
    Thanks

    action_name = 'Cancel' action_view = lr_view_controller ).
    IT SHOULD BE IN CAPS I.E. CANCEL NOT Cancel
    so write it like
    action_name = 'CANCEL' action_view = lr_view_controller ).                  " cancel in caps CANCEL
    This will work.
    thanks
    sarbjeet singh
    Edited by: sarbjeet  singh on Feb 9, 2011 3:26 PM

  • How does one add tables to an existing universe using COM designer SDK.

    Morning All
    How does one add tables to an existing universe using COM designer SDK. I have tried:
    objUniverse.Tables.Add (strTable_Name)
    but get "Cannot create Table" error.
    Any ideas?
    Thanks in advance.
    Anita

    Hi Anita,
    -Use the Add method to add classes and objects to an existing universe using a VB 6 application.
    Adding a Class
    Definition: Function Add(Name As String) As Class
    Syntax: NameOfClassesVariable.Add
    Adding an Object Instance
    Definition:  Function Add(Name As String, [ClassName As String]) As Object
    Syntax: NameOfObjectsVariable.Add(name, [class])
    - name is the name of the object.
    - class is the name of the class containing the object. This parameter should be used in cases where more than one objects exist with the same name.
    Sample Visual Basic 6 Code
    Dim DesApp As Designer.Application
    'MODIFY AND EXPORT CLASSES AND OBJECTS OF AN EXISTING UNIVERSE
    Sub modify_and_export_universe()
    Dim DesUnv As Designer.Universe
    Dim DesCls As Designer.Class
    Dim DesObj As Designer.Object
    Dim DesDBCol As Designer.DBColumn
    Dim DBColName As String
    Set DesApp = New Designer.Application
    'Login to designer
    Call DesApp.LogonDialog
    'Make sure to log on with your administrator profile
    'e.g : "hostname","username", "password","Enterprise"
    'Make Designer application visible
    DesApp.Visible = True
    'This line disable warning messages from Designer
    DesApp.Interactive = False
    'to Open  locally  the universe you want to modify
    'Set DesUnv = DesApp.Universes.Open("club_uni")
    'Use OpenFromEnterprise method (Universes Class) to import a universe from the repository and opens it
    Set DesUnv = DesApp.Universes.OpenFromEnterprise("Universes", "club_uni", False)
    'Add a valid connection which already exists
    DesUnv.Connection = "club"
    'open the universe
    'Call DesApp.Universes.Open("club_universe")
    'Add the table Account and refresh the view in the main window
    Set DesTab = DesUnv.DBTables.Item("Customer").Insert
    DesUnv.ArrangeTables
    'Add a class
    Set DesCls = DesUnv.Classes.Add("Class MyCustomer")
    'Looping through all the fields of the DB Table Account
    For Each DesDBCol In DesUnv.DBTables.Item("Customer").DBColumns
    'Store name of the column
        DBColName = DesDBCol.Name 
         'Add an object to the class
        Set DesObj = DesCls.Objects.Add("Obj " & DBColName)
         'Affect a field to the object
        DesObj.Select = "Customer" & "." & DBColName
    Next
    'Save the existing universe with the same name club_uni or you can change
    DesUnv.SaveAs "club_uni"
    MsgBox "Universe created and saved Class MyCustomer has been added!!"
    'Close the universe
    UnvFullName = DesUnv.FullName
    MsgBox "The UniverseFilePath is " & UnvFullName
    'Close the universe
    DesUnv.Close
    'This line disable warning messages from Designer
    DesApp.Interactive = False
    'Export the universe to the CMS DB (to the last universe folder)
    'Make sure you save the universe before exporting it
    Call DesApp.Universes.Export("Universes", UnvFullName)
    MsgBox "This document has been exported successfully !!"
    'Close designer
    DesApp.Quit
    Set DesApp = Nothing
    End Sub
    Hope this helps.
    Regards,
    Deepti Bajpai

  • There are no functions containing returntype = 'query' and access!

    Hi there
    I am trying to add a recordset after defining a datasource and I keep getting the error when I do a CFC query search
    there are no functions containing returntype = 'query' and access!. I have attached an image to show the error messag I get.
    Can someone help me fix this? my datasource shows up as correctly configured in cold fusion and the mysql database is well configured as well.

    okay, adding another function to the CFC and saving it makes
    it suddenly, magically visible to the function invocation window?
    I don't understand.

Maybe you are looking for

  • How to import images into keynote without losing quality?

    Whenever I import (either by dragging or through keynote import) high resolution images (either jpg or png) at high resolution (say 1920x1280) into any keynote presentation (1280x1024) it somehow automatically gets compressed into a really ugly lowre

  • Too much static text in a flash movie clip makes it slow?

    Hello... First of all, I am new to flash. I have one pre-designed web site made entirely in flash. I have made a lot of modifications to the website, changing text, images, adding effects, text and all sorts of things. The navigation bar has 5 button

  • Variable not getting the filename

    Hello Experts I am new to ODI. when i am using variable for filename its not working. Please suggest. Thank you

  • TERRIBLE new forum design...

    What is it with these guys??!! The previous discussions board was intuitive and easy to navigate, it was a pleasure to communicate with other FCP users around the world... The new design is a huge pain in the arse, lacks information, is full of amate

  • How do I change file Type's

    How can I change my projects that I've done in Printshop - placed them in a folder in my document file - the are in a: Type SIG File - I cannot open them...  Would like to change these documents into a: "Adope Reader X File type.     How can I do thi