Easy join of 2 tables and count of specify column

Hi,
I have these two tables:
servers, records (contains info about server's fixes)
server has: id, description
records has: id, server, action
I would like to this view:
NameOfServer | Number of all applied fixes
serverA |120
serverB |180
I try this:
select records.server, COUNT(server) as countt
FROM records
GROUP BY records.server
HAVING COUNT(records.server) > 0
ORDER BY COUNT(records.server) desc
But first column had IdOfServer (as int), so I try JOIN:
SELECT records.server, COUNT(records.server) as countt, servers.description, servers.description
FROM records
LEFT JOIN servers
ON servers.id = records.server
GROUP BY records.server
HAVING COUNT(records.server) > 0
ORDER BY COUNT(records.server) desc
Bold text is problem: "servers.description" (which is varchar) had error message:
... is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Thx fo hint(s), Jerry

If you do not need this column as per your post , just do not specify it in the SELECT statement , otherwiseuse Jay reply.SELECT records.server, COUNT(records.server) as counttFROM records
LEFT JOIN servers
ON servers.id = records.server
GROUP BY records.server
HAVING COUNT(records.server) > 0
ORDER BY COUNT(records.server) desc
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • How to provide joins between oracle tables and sql server tables

    Hi,
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server.
    how to provide joins between oracle tables and sql server tables ? Any help on this
    Regards,
    Malli

    user10675696 wrote:
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server. Bad idea most times. Heterogeneous joins do not exactly scale and performance can be severely degraded by network speed and b/w availability. And there is nothing you can do in the application and database layers to address performance issue at the network level in this case - your code's performance is simply at the mercy of network performance. With a single glaring fact - network performance is continually degrading. All the time. Always. Until it is upgraded. When the performance degradation starts all over again.
    If the tables are not small (few 1000 rows each) and row volumes static, I would not consider doing a heterogeneous join. Instead I would rather go for a materialised view on the Oracle side, use a proper table and index structure, and do a local database join.

  • Prcedure to joining of two tables and pls explore the primary & foriegn key

    Dear All,
    Am new to this forum looking forward to have some discussions and guidance reg ABAP.
    <b>My query is</b>
    what is the prcedure to joining of two tables and pls explore the primary & foriegn key relationships.
    Your kind help is required in this query .
    Thanks n regards
    Carol P

    Hi Carol,
    Joining two tables fetch data from tables that has relevent entry based on the keys. like LIKP and LIPS these are delivery tables. if the business requirement is fetching delivery data that are exists in both two tables. here LIKP will conatins a single entry against a condition and LIPS may contains several entry because one delivery may has multiple line items. so, fetch the data joining the two tables on vbeln that is delivrey number. this is used to increase the performance of the program except for all entries.
    Foreign key is poiting twowards primary key; it may be 1:1 , 1:many and many:many. if field1 of table a is pointing towards field1 of table b. then based on these condition at the time of entry SAP will check how many entry can be entred in field1 of table a.
    regards
    Krishnendu

  • Inner join on Buffred table and not buffered table.

    Hi guys,
       Can you suggest me how can i write select query using inner join on buffered table and not buffered table. i written like this. is it right?
    SELECT a~vbeln                         
             a~vkorg   
             a~kunnr                         
             a~kunag                         
             a~wadat_ist 
             a~xblnr                         
             b~bukrs
       FROM likp AS a INNER JOIN tvko AS b
        ON avkorg = bvkorg BYPASSING BUFFER
      INTO TABLE itab_likp
      WHERE vbeln = s_vbeln.              
    Thanks.
    RAJ

    Hi Raj ,
    Please find below my Commentes :
    1. When you use "Bypassing buffer" clause in Select statement , the data what is there in the buffer of application sever is always ignored and Read is performed from the Physical database always. This Clause is advisable where you require realtime data (Not recommended generally in reporting)
    2. It is advisable that you should not use small table in the innerjoin with big table. In the query you have written there are 2 tables:- LIKP and TVKO outof which TVKO is a master table containing very few records than LIKP (Contains huge data for Delivery header).
    So my recommendation will be : -
    1. Eliminate the "Bypassing Buffer" clause from your Query
    2. Break the select query into 2 select queries breaking the join and with some ABAP logic populate the Internal table "itab_likp".
    This will be optimum way inwhich you can write the select query for your senarion. Also Ensure that indexes are being used for better selectivity.
    Hope this will help to you.
    Regards,
    Nikhil

  • How to disable a single cell in a table (and not the whole column)

    Hi there,
    I've got a webdynpro table with a few columns, rows can be created dynamically through a button in the table toolbar.
    Depending on the value of a certain cell I have to disable another cell (in the same row).
    I tried to manipulate the view in the modifyview but no joy. I also tried to manipulate the attribute property through the coding below:
      DATA lv_knttp TYPE knttp.
      lo_nd_kostl = wd_context->path_get_node( path = `MULTIVALUES.KOSTL` ).
      lo_el_kostl = lo_nd_kostl->get_element( ).
      lo_el_kostl->set_attribute_property(
      attribute_name = 'LTEXT'
              property       = lo_el_kostl->e_property-enabled
              value          = ''
    but it disables the whole column!!!! I just need the cell to be disabled (I thought the code above, through the lead selection, would affect a certain cell only - but I was wrong).
    Any ideas?
    Thanks!!!

    Hi,
    using cell variants you can do this.,
    check this article: [Cell Variants in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproforABAPCellVariants]
    Instead of binding the read only property of table as a whole , just bind the read only property of column group of table., You can do this bu drill down the table and select the required column and bind the read only column.,
    then In onAction Event of button .,
    loop the table, if condition satisfied set the read only property to true else false.,!!
    hope this helps u.,
    Thanks & regards,
    Kiran

  • Join multiple fact tables and dimensions and use all tables in report issue

    Hi,
    I have a report requirements and need to use multiple fact tables and unconformed dimensions as described below
    Fact table: F1,F2,F3
    Dimensions tables: D1.....D9
    F1:(joined to) D1,D2,D3,D4
    F2::(joined to)D1,D2,D5,D6
    F3::(joined to)D1,D2,D7,D8
    D7::(joined to)D9,D8 (dimension D7 joined to two other dimensions D9 and D8
    I'm trying to use columns from almost all the fact and dimension tables but getting "Unable to navigate requested expression. Please fix the metadata consistency warnings."
    Repository is consistent and no errors and warnings.
    How can I configure the repository to develop reports using all fact tables and dimensions?
    Appreciate for your help.
    Thanks
    Jay.
    Edited by: Jay on Feb 9, 2012 4:14 PM

    So you want me to convert snowflake schema to star. does it solve my problem? individual star queries are working find but when I query multiple stars together getting inconsistency errors. I removed content tables dim level totals for unconformed dimensions in logical fact LTS and set level for measures at total level for unconformed dimensions. it is still in progress and need to test.
    Thanks
    Jay.

  • Join two source tables and replicat into a target table with BLOB

    Hi,
    I am working on an integration to source transaction data from legacy application to ESB using GG.
    What I need to do is join two source tables (to de-normalize the area_id) to form the transaction detail, then transform by concatenate the transaction detail fields into a value only CSV, replicate it on the target ESB IN_DATA table's BLOB content field.
    Based on what I had researched, lookup by join two source tables require SQLEXEC, which doesn't support BLOB.
    What alternatives are there and what GG recommend in such use case?
    Any helpful advice is much appreciated.
    thanks,
    Xiaocun

    Xiaocun,
    Not sure what you're data looks like but it's possible the the comma separated value (CSV) requirement may be solved by something like this in your MAP statement:
    colmap (usedefaults,
    my_blob = @STRCAT (col02, ",", col03, ",", col04)
    Since this is not 1:1 you'll be using a sourcedefs file, which is nice because it will do the datatype conversion for you under the covers (also a nice trick when migrating long raws to blobs). So col02 can be varchar2, col03 a number, and col04 a clob and they'll convert in real-time.
    Mapping two tables to one is simple enough with two MAP statements, the harder challenge is joining operations from separate transactions because OGG is operation based and doesn't work on aggregates. It's possible you could end up using a combination of built in parameters and funcations with SQLEXEC and SQL/PL/SQL for more complicated scenarios, all depending on the design of the target table. But you have several scenarios to address.
    For example, is the target table really a history table or are you actually going to delete from it? If just the child is deleted but you don't want to delete the whole row yet, you may want to use NOCOMPRESSDELETES & UPDATEDELETES and COLMAP a new flag column to denote it was deleted. It's likely that the insert on the child may really mean an update to the target (see UPDATEINSERTS).
    If you need to update the LOB by appending or prepending new data then that's going to require some custom work, staging tables and a looping script, or a user exit.
    Some parameters you may want to become familiar with if not already:
    COLS | COLSEXCEPT
    COLMAP
    OVERRIDEDUPS
    INSERTDELETES
    INSERTMISSINGUPDATES
    INSERTUPDATES
    GETDELETES | IGNOREDELETES
    GETINSERTS | IGNOREINSERTS
    GETUPDATES | IGNOREUPDATES
    Good luck,
    -joe

  • How to join multiple source tables and do lookup?

    I have a requirement to load a target table by joining 4 source tables. Also I have to do a lookup on a domain table to transform codes and check for nulls. What will be the best approach to load the target table?
    Is it possible to do it in one interface or do I need to build multiple interfaces to achive this?
    My source and target database both are oracle and I am planing to use Oracle Incremental Update Merge.
    Thank you

    You are in the right direction by creating one interface for this transformation.
    You will need to drag drop 4 source tables + the lookup table on the Sources window of Interface and then make appropriate joins.
    Also, check for NULLS in the transformation. Depends what you want to do with the NULLS. If you want to ignore them, use a filter.
    If you want them to error out, use a constraint.
    If you want to convert them, use NVL
    Start with Oracle Incremental Update and once successful, use Oracle Incremental Update MERGE.

  • Total count and count based on column value

    Primaryid  Id     Status
    1            50          1
    2            50          1
    3          50          1
    4            50          3
    5           50          2
    6            50          1
    7            51         1
    8            51         2Im looking for a query which returns total count of rows for id 50 and count of rows with status 1
    something like
    Id    count_total   count_total_status1
    50        6              4
    51        2              1Any suggestion ?

    SQL> select * from t4;
    PID ID STATUS
    1 50 1
    2 50 1
    3 50 1
    4 50 3
    5 50 2
    6 50 1
    7 51 1
    8 51 2
    已选择8行。
    SQL> select distinct id,count(id),sum(decode(status,1,1,0)) from t4 group by id;
    ID COUNT(ID) SUM(DECODE(STATUS,1,1,0))
    51 2 1
    50 6 4

  • Retrieve data from 2 columns of 2 different tables and display in 1 column

    Hi,
    Is it possible to retrieve data from 2 different columns of 2 different tables and display it in the same column of a datablock in a form.
    For example:
    Table A
    Col1
    1
    2
    3
    Table B
    Col1
    2
    4
    5
    The column from the datablock in the form should display the following:
    1
    2
    3
    2
    4
    5

    You can create a view
    select ... from table_a
    union
    select ... from table_b
    and base the block on that.
    However, if you want to allow DML on the block it gets more complicated.

  • View joining two spatial tables and strange CBO behaviour

    Hi all,
    I've following view in my database:
    CREATE OR REPLACE VIEW my_view AS
    SELECT id, 'table1' AS source, location FROM my_table1
    UNION ALL
    SELECT id, 'table2' AS source, location FROM my_table2;
    When I execute query:
    SELECT * FROM my_view WHERE SDO_RELATE(location, SDO_GEOMETRY(...), 'mask=anyinteract') = 'TRUE';
    It works as expected.
    When running query like (getting location with subquery):
    SELECT * FROM my_view WHERE SDO_RELATE(location, (SELECT location FROM my_table3 WHERE id = 123, 'mask=anyinteract') = 'TRUE';
    It doesn't work. Oracle Throws "DatabaseError: ORA-13226: interface not supported without a spatial index"
    Further investigation revealed strange behaviour of CBO:
    In first case Oracle CBO uses Spatial index just fine and as expected.
    But second query and CBO get's a bit strange - unique index scan is used for subselect, but for view tables is full table scan is used and SDO_RELATE is not happy with that since no spatial index is used.
    How I can use spatial indexes regardless of that subselect?

    Hi folks,
    Looking over these responses and not finding a lot of clarity yet in terms of leaving a trail for future readers to glean an answer from.  I was just looking through the back-and-forth and curious myself about the issue  First of all I think Jani's observations are quite on target.  This CBO reaction is weird and does not work they way most Oracle users would expect it to work.  Secondly, Jani really should tell us his Oracle version and folks providing answers should as well - the CBO is always being tweaked.  Thirdly, Stefan provides a solution though it's a rather expensive solution to my taste.  And finally, I think we as a group need to spend a bit more time reproducing things in code.  I will give it a shot, feel free to correct anything I got wrong.
    So first of all, I wrote this up quick on 12.1.0.2 and verified it was the same on 11.2.0.4
    DROP TABLE my_table1 PURGE;
    CREATE TABLE my_table1(
        objectid INTEGER NOT NULL
       ,tsource  VARCHAR2(30 Char)
       ,shape    MDSYS.SDO_GEOMETRY
       ,PRIMARY KEY(objectid)
    DROP TABLE my_table2 PURGE;
    CREATE TABLE my_table2(
        objectid INTEGER NOT NULL
       ,tsource  VARCHAR2(30 Char)
       ,shape    MDSYS.SDO_GEOMETRY
       ,PRIMARY KEY(objectid)
    DROP TABLE my_table3 PURGE;
    CREATE TABLE my_table3(
        objectid INTEGER NOT NULL
       ,tsource  VARCHAR2(30 Char)
       ,shape    MDSYS.SDO_GEOMETRY
       ,PRIMARY KEY(objectid)
    CREATE OR REPLACE PROCEDURE seeder(
       p_count IN NUMBER
    AS
       sdo_foo MDSYS.SDO_GEOMETRY;
       int_counter NUMBER := 1;
       FUNCTION random_line
       RETURN MDSYS.SDO_GEOMETRY
       AS
          num_x1 NUMBER;
          num_y1 NUMBER;
          num_offx NUMBER;
          num_offy NUMBER;
       BEGIN
          num_x1 := dbms_random.value(-179,179);
          num_y1 := dbms_random.value(-89,89);
          RETURN MDSYS.SDO_GEOMETRY(
              2002
             ,8265
             ,NULL
             ,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1)
             ,MDSYS.SDO_ORDINATE_ARRAY(
                  num_x1
                 ,num_y1
                 ,num_x1 + 0.0001
                 ,num_y1 + 0.0001
       END random_line;
    BEGIN
       FOR i IN 1 .. p_count
       LOOP
          sdo_foo := random_line();
          INSERT INTO my_table1
          VALUES (
              int_counter
             ,'table1'
             ,sdo_foo
          int_counter := int_counter + 1;
          sdo_foo := random_line();
          INSERT INTO my_table2
          VALUES (
              int_counter
             ,'table2'
             ,sdo_foo
          int_counter := int_counter + 1;
          sdo_foo := random_line();
          INSERT INTO my_table3
          VALUES (
              int_counter
             ,'table3'
             ,sdo_foo
          int_counter := int_counter + 1;
       END LOOP;
       INSERT INTO my_table1
       VALUES (
           0
          ,'table1'
          ,MDSYS.SDO_GEOMETRY(
               2002
              ,8265
              ,NULL
              ,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1)
              ,MDSYS.SDO_ORDINATE_ARRAY(
                   -87.8211111
                  ,42.5847222
                  ,-87.8212
                  ,42.5848
       INSERT INTO my_table3
       VALUES (
           0
          ,'table3'
          ,MDSYS.SDO_GEOMETRY(
               2002
              ,8265
              ,NULL
              ,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1)
              ,MDSYS.SDO_ORDINATE_ARRAY(
                   -87.8211111
                  ,42.5848
                  ,-87.8212
                  ,42.5847222
       COMMIT;
    END seeder;
    BEGIN
       seeder(100000);
    END;
    SELECT 'my_table1: ' || COUNT(*) AS invalid_count FROM my_table1 WHERE MDSYS.SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(shape,0.05) <> 'TRUE'
    UNION ALL
    SELECT 'my_table2: ' || COUNT(*) AS invalid_count FROM my_table2 WHERE MDSYS.SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(shape,0.05) <> 'TRUE'
    UNION ALL
    SELECT 'my_table3: ' || COUNT(*) AS invalid_count FROM my_table3 WHERE MDSYS.SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(shape,0.05) <> 'TRUE';
    BEGIN
       INSERT INTO user_sdo_geom_metadata(
           table_name
          ,column_name
          ,diminfo
          ,srid
       ) VALUES (
           'MY_TABLE1'
          ,'SHAPE'
          ,MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,.05),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,.05))
          ,8265
       COMMIT;
    EXCEPTION
       WHEN OTHERS
       THEN
          NULL;
    END;
    BEGIN
       INSERT INTO user_sdo_geom_metadata(
           table_name
          ,column_name
          ,diminfo
          ,srid
       ) VALUES (
           'MY_TABLE2'
          ,'SHAPE'
          ,MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,.05),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,.05))
          ,8265
       COMMIT;
    EXCEPTION
       WHEN OTHERS
       THEN
          NULL;
    END;
    BEGIN
       INSERT INTO user_sdo_geom_metadata(
           table_name
          ,column_name
          ,diminfo
          ,srid
       ) VALUES (
           'MY_TABLE3'
          ,'SHAPE'
          ,MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,.05),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,.05))
          ,8265
       COMMIT;
    EXCEPTION
       WHEN OTHERS
       THEN
          NULL;
    END;
    CREATE INDEX my_table1_spx ON my_table1
    (shape)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    NOPARALLEL;
    CREATE INDEX my_table2_spx ON my_table2
    (shape)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    NOPARALLEL;
    CREATE INDEX my_table3_spx ON my_table3
    (shape)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    NOPARALLEL;
    BEGIN
       dbms_stats.gather_table_stats(USER, 'MY_TABLE1');
       dbms_stats.gather_index_stats(USER, 'MY_TABLE1_SPX');
       dbms_stats.gather_table_stats(USER, 'MY_TABLE2');
       dbms_stats.gather_index_stats(USER, 'MY_TABLE2_SPX');
       dbms_stats.gather_table_stats(USER, 'MY_TABLE3');
       dbms_stats.gather_index_stats(USER, 'MY_TABLE3_SPX');
    END;
    CREATE OR REPLACE VIEW my_view
    AS
    SELECT
    objectid
    ,'table1' AS tsource
    ,shape
    FROM
    my_table1
    UNION ALL
    SELECT
    objectid
    ,'table2' AS tsource
    ,shape
    FROM my_table2;
    set timing on;
    -- QUERY #1
    -- Jani's original setup, works as expected
    SELECT
    COUNT(*) AS single_geom_counter
    FROM
    my_view a
    WHERE
    MDSYS.SDO_RELATE(
        a.shape
       ,MDSYS.SDO_GEOMETRY(
            2002
           ,8265
           ,NULL
           ,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1)
           ,MDSYS.SDO_ORDINATE_ARRAY(
                -87.8211111
               ,42.5848
               ,-87.8212
               ,42.5847222
       ,'mask=anyinteract'
    ) = 'TRUE';
    -- QUERY #2
    -- Now the problem statement
    SELECT
    COUNT(*) AS table_problem_counter
    FROM
    my_view a
    WHERE
    MDSYS.SDO_RELATE(
        a.shape
       ,(SELECT b.shape FROM my_table3 b WHERE b.objectid = 0)
       ,'mask=anyinteract'
    ) = 'TRUE';
    -- QUERY #3
    -- Stefan's solution
    SELECT  /*+ ORDERED */
    COUNT(*) AS stefans_solution
    FROM
    my_table3 a
    ,my_view b
    WHERE
    a.objectid = 0
    AND MDSYS.SDO_RELATE(
        a.shape
       ,b.shape
       ,'mask=anyinteract'
    ) = 'TRUE';
    Anyhow, so the hard coded query #1 that Jani provided works exactly the way most folks would expect, the second item in the relate is applied to each spatial index participating in the view.  I think we can agree this is what we want.
    Now when we move on to the problem, well its all goes off the rails as I think its looks to apply the spatial filter to the view itself which lacks an index (not sure really)
    So as Stefan says, you can work around this by rewriting things as query #3 does above though now its a full table scan of both tables in the view.  This is a long way performance wise from Query #1!
    So on my 12c test box
       query #1 Elapsed: 00:00:00.016
       query #3 Elapsed: 00:00:33.534
    On 11g production box
       query #1 Elapsed: 00:00:00.49
       query #3 Elapsed: 00:02:31.45   (ouch!)
    So hopefully someone else can jump in with more information on better solutions?  
    I overall tend to avoid the kind of unioned views that Jani is using here.  I have a hard time recalling why but I must have been burned similarly many years ago when I was first starting with Oracle spatial.  I tend to always want my spatial indexes right there where I can keep a grim stink eye on them.  It may be that a unioned view with multiple spatial indexes behind it might just be a bad practice better done with a materialized view?  Or maybe a lesser term?  Unprofitable practice?  fraught?  "Best if you don't do that"?
    Anyhow, I would be interested in what others have as input on the matter.
    Cheers,
    Paul

  • Join between fact table and master data table

    Is it posible to join a Cube with a Characteristic? This is exactly what i need:
    - In my cube i have date (0CALDAY) and (among others) a characteristic (ZCHAR) and a key figure (ZKEYF).
    - I added a key figure (ZKFAT) as an attribute to ZCHAR. So the tables look something like this:
    Fact table:
    <b>0CALDAY | ZCHAR | ZKEYF</b>
    12.10.2006 | CHAR1 | 10
    12.10.2006 | CHAR2 | 20
    12.10.2006 | CHAR3 | 30
    Master data table for ZCHAR:
    <b>ZCHAR | ZKFAT</b>
    CHAR1 | 1000
    CHAR2 | 2000
    CHAR3 | 1500
    I need to make a query with a table that looks like this:
    <b>0CALDAY | ZCHAR | ZKEYF | ZKFAT</b>
    12.10.2006 | CHAR1 | 10 | 1000
    12.10.2006 | CHAR2 | 20 | 2000
    12.10.2006 | CHAR3 | 30 | 1500
    Finally, the query should result in something like this:
    <b>0CALDAY | ZKEYF | ZKFAT</b>
    12.10.2006 | 10 | 1000
    12.10.2006 | 20 | 2000
    12.10.2006 | 30 | 1500
    Adding KFAT to the fact table is not an option, i need to read this information directly from ZCHAR.
    I've tried using MultiProviders but didn't get the result i need.
    Is there any way to achieve this? Please advice.
    Thank you,

    Thank you Ram C. i've tried your solution and it may be it, but i'm having one problem:
    Since i'm reporting in web, i used the second solution you offered and almost got the desiered result. The problem is that some entries are correct but others ar duplicated! Using same example, my result table looks something like this:
    <b>0CALDAY | ZKEYF | Calculated KF (from ZKFAT)</b>
    12.10.2006 | 10 | 1000
    12.10.2006 | 20 | 4000
    12.10.2006 | 30 | 1500
    Second row should be 2000, but instead it shows 4000. I added ZCHAR's attribute ZKFAT as a display attribute in order to compare the results. I found that the display attribute is correct (2000) but the Calculated KF still showed duplicated data (4000).
    By the way, when i execute the query, i get this warning message:
    "Calculated key figure ZRT_C02_2_CKF004 is not defined correctly"
    Any ideas why this could be happening?
    Thank you for your help.
    Message was edited by: Gerardo Gaona

  • To create a fixed row in the bottom of table and to merge three columns

    Hi,
    I have a table displaying some values but is there any way to get a fixed row at the bottom which will sum the values above.
    ie
    service   business  jan       feb       mar      april
    table       cut          900       100      100      200
    chair       blade       100        200      300     400
    sum                       1000      300      400    600
    so the final row i need it to be constant even if i scroll down the table, this row should be always fixed and visible. and the table data are filled dynamically.. so i dont know the no of rows available as well.
    How can I do it. Any insight on it will be helpful.
    Thanks and Regards
    Tenzin

    Hi,
    CL_WD_TABLE - >SET_FOOTER_VISIBLE where you can provide that summation in the footer.
    As you are calculating the sum there will be the Name for that field to hold summation value right.
    Based on the name of that field you can set it to the footer by passing the necessary paramters to that
    method.
    How are you filling the table.
    Regards,
    Lekha.

  • Csv file to database tables and also foreginkey related columns directly

    i have created dimensions tables in ssis  and i need to load  the data into that tables from my given csv files. iand i have foriegien key columns of fact table for this also data need to load

    definitely we have primary key relations..  the tables contain primary keys and forien keys  i have created tables nearly 20 tables  in sql server some of them consist of dimensions and facts.. so i have an csv files of data. so that i need
    to load data in that tables by using ssis package
    i have an idea taking one data flow task in control flow task for  each and every single table i am taking one oldb destination. for each and every one i need source as csv file. by connecting this both we can load data
    but i need to load data into 20 tables by taking on dataflow task..how it is possible any solution and any different ways to load data from csv files to ssispacke tables

  • Join 2 tables and display in Master Detail Form

    Hello Everyone,
    Please help me out on the following.
    I have 2 tables with common field ID I want to join the 2 tables and will show the results on Master Detail form .Please suggest me on this thing .
    Thanks

    Hi,
    The ID primary key on the details table should be ok provided you have some means of populating it - usually via a trigger that gets a new sequence number.
    When the page is loaded, do you see data in the details tabular form? Or is the problem only for when you are creating entirely new master/detail records?
    When adding a new record into the details form, the FK field should be populated with the PK of the master form by default. On this report, go to the Contract_Number column and have a look at the Column Attributes for it. You should see a section for Tabular Form Element and in there are two settings - Default Type and Default. The Default Type should be Item.... and the Default should be the master record's PK page item name (eg, P1_CONTRACT_NUMBER). Underneath these settings should be the settings Referrence.... - check that these correctly point to the field on the details table. If you have different settings, try changing them - otherwise, list them here so that we can check
    Andy

Maybe you are looking for