Combine 2 specific column values into one column

Is there an easy solution to combine column values that is in a group?
In my report I have 1 column group named Activity_Area which has 5 different values Activity 1, Activity2...Activity5.
Let's say I want to merge Activity 4 and Activity 5 and call it ActivityX and gives me the output as below
Activity 1 | Activity 2 | Activity 3 | ActivityX

Hi Jhonny86,
According to your description, you create a field in database and it contains five values. Then you want to only display four values in report column group, and the last two values should be replaced by “ActivityX”, right?
In your scenario, you can create an table like below:
create table Act(id int,activity varchar(99))
insert into Act select 1,'Activity 1'
insert into Act select 2,'Activity 2'
insert into Act select 3,'Activity 3'
insert into Act select 4,'Activity 4'
insert into Act select 5,'Activity 5'
Then query the table with code like below in query designer, then add the field [Act] into the column group.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support

Similar Messages

  • Problem in Showing multiple values into one text box.

    Hi all,
    How can show i multiple row values into one text box. here text box is multi line type.
    i have one table it has content column, it has number of rows. i need to show those data into one text box in form. how can i solve it?
    my sample code here,
    egin
    --:block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
    -- go_item('txt_from');
    insert into chat(fromid,toid,content)values(:block3.fromid,:block3.toid,:block3.txt_From);
    :block3.txt_From:= null;
    commit;
    :block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
    go_item('txt_from');
    declare
    cursor c4 is select content from chat where toid = :block3.fromid;
    rec1 c4%rowtype;
    begin
    open c4;
    loop
    fetch c4 into rec1;
    exit when c4%notfound;
    null;
    end loop;
    end;
    --select content into :block3.txt_to from chat where toid= :block3.fromid;
    end;
    please give me some tips to solve it.
    thanks
    gurus

    Hi,
    Try giving CHR(10) for line feed.
    DECLARE
         CURSOR C4 IS SELECT CONTENT FROM CHAT WHERE TOID = :BLOCK3.FROMID;
         Str_Temp VARCHAR2(20);
    BEGIN
         :BLOCK3.TXT_TO := '';
         OPEN C4;
         LOOP
              FETCH C4 INTO Str_Temp;
              EXIT WHEN C4%NOTFOUND;
              :BLOCK3.TXT_TO := :BLOCK3.TXT_TO || CHR(10) || Str_Temp;
         END LOOP;
         CLOSE C4;
    END;Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • How to integrate existing value into one in hierarchy char.

    I have a char. hierarchy call ZCOMP_CODE. ZLEADER is compounding with ZCOUNTRY.
    The master data in ZCOMP_CODE looks like
    ZLEADER;ZCOMP_CODE;
    010;1000;
    010;1001;
    010;1002;
    020;1000;
    021;1000;
    In query  I have char. ZCOMP_CODE in row and one KF ZREVENUE in column. Previously we calculated ZLEADER 010,020,021 separately. But, now I want to calculated ZLEADER 020 and 021 together. Does anyone know how to integrate two existing value into one and display it in query? Do I need to create a new hierarchy node for including 020,021?
    Thanks!
    rajatina.

    don't know how you can achieve this in the query...
    but in the workbench there's a solution. Just add a routine in the transformation to change 021 to 020.
    if you need to have still the 021 info somewhere, create a ZCOMPANY_CODE2 where you store only the values needed (010, 020)... use this company code as hierarchy in the report, and use the other company code for displaying the 021...
    hope it's clear,
    M.

  • HT204053 how do I combine all my apple ids into one apple id

    Is there a way to combine all my apple ids into one new apple id so all my previous purchases are on one id?
    Thanks

    Unfortunately, you can't.  IDs can't be merged.  You'll just have to pick the ID whose itunes account has the most purchased items.

  • How do I combine two user iPhoto files into one...keeps blocking the pics between users

    How do I combine two user iPhoto files into one...keeps blocking the pics between users on the same Mac?

    Put the library on an external hard drive that is formatted as shown in this screenshot:
    OT

  • How do I combine two or more pictures into one?

    How do I combine two or more pictures into one?

    I found out how to do what I wanted and I'm giving my steps in hopes that it might help someone else.  I wanted to put several photos from a file onto a new blank image.  This is what I did.
    1.  Create a blank page.    File/New/ Blank File.   Put in the size.  I used 8x10.
    2.  Bring the photo  you want to use into Elements as you always do. It will list along the top next to the blank sheet.
    3.  Choose SELECT (top of screen)/ Select All.
    4.  Choose Edit/Copy   or Command "C"
    5.  Click on the Blank File.   Chose Edit/Paste  or Command "V"
    6.  Click on Image/ Transform or Command "T".  There should be a dotted line around your pasted image.  You can then move and adjust the image to how you want it.  When finished, press the check-mark on lower right of photo.
    7.   Repeat this with all the photos you want on the new blank file.
    8.  You will see on lower right of Elements,  the background layer and as many layers as you have photos.  These layers need to be permanently placed on the background layer. Go to Layers and press Merge Visible.  This will merge all layers to the background.
    9.  Save as and you are done.

  • How to combine a few PDF files into one with Adobe reader?

    how to combine a few PDF files into one with Adobe reader?

    Hi aho,
    You would need either Acrobat (link to free 30 day trial) or our PDF Pack subscription service to perform that task.
    What can I do with Reader?
    Let me know if you have further questions!
    Regards, Stacy

  • Storing and retrieving multiple values into one cookie.

    Hi Everyone,
    I am wondering if anybody knows of any good tutorials involving storing multiple values into one cookie. Any URLs will be greatly apprecated. Thanks heaps.
    Regards
    Davo

    These are normally delimted in HTTP by a semicolon. You can concatenate the string yourself and on the reverse trip use StringTokenizer to get the values back out.
    - Saish

  • Combining 2 grahics or more into one

    Using AS3 code, is it possible to combine 2 graphics or more into one?
    Example : combining a rectangle and a triangle to make a nice arrow?

    Do you know anything about AS3 drawing API - I guess this is what you need to use:
    This is an example of how one can draw rectangle:
    var sp:Sprite = new Sprite();
    sp.graphics.beginFill(0xff0000);
    sp.graphics.drawRect(0, 0, 100,200);
    sp.graphics.endFill();
    addChild(sp);
    Read:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Graphics.html
    And this:
    http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000176.html

  • Combine mac, me, iCloud accounts into one

    How can I combine @mac, @me, @icloud accouts into one?

    ggsinokc wrote:
    They all have the same before@.
    Then they are already all the same account.
    However I get duplicate emails.
    Obviously you shouldn't. If you send yourself a message to [email protected], do you get more than one message delivered? What address shows in the 'To' field? (if just your name shows, click and hold on it to show the address).

  • All column value into one

    SELECT
    CONTROLLER_MODEL_NUMBER_1,
    SERIAL_NUMBER_1,
    CONTROLLER_MODEL_NUMBER_2,
    SERIAL_NUMBER_2,
    CONTROLLER_MODEL_NUMBER_3,
    SERIAL_NUMBER_3,
    CONTROLLER_MODEL_NUMBER_4,
    SERIAL_NUMBER_4,
    CONTROLLER_MODEL_NUMBER_5,
    SERIAL_NUMBER_5
    FROM controller
    I need to get above query as two columns as controller_model and serial_number all the controler_model_number_1 to 5 must come under controller_model similary serial_number as well
    I am currently using union to get into one but this is affecting the performance please suggest me an alternative way
    Thanks
    Sudhir

    Hi,
    Thank you so much this actually worked for me but only issue i found was not able add the cross join please check the below code
    Select
    distinct
    'Parature' "Source",
    NULL "Distibutor",
    reseller_name "Reseller",
    NULL "Reseller City",
    NULL "Reseller State",
    A.Country "Reseller Country",
    DECODE (a.state, 'APAC', 'APAC', 'EMEA', 'EMEA', NULL, 'Unknown', 'US' ) "Reseller Theater",
    NULL "Customer Name",
    NULL "Customer City",
    NULL "Customer State",
    NULL "Customer Country",
    NULL "Customer Theater",
    NULL "Sales Book Date",
    NULL "Ship Date",
    c.sales_order_number "Sales Order Number",
    C.Po_Number "PO Number",
    c.contract_id "Contract ID",
    product_name "Support Name",
    TO_DATE (c.contract_purchase_date) "Start Date",
    TO_DATE (c.contract_expiration_date) "Expire Date",
    NULL "Header Status",
    NULL "Line Status",
    NULL "Line Type",
    NULL "Termination Reason",
    Null "Location_id",
    Null "Product_id",
    DECODE(rn,1,controller_model_number_1,
    2,CONTROLLER_MODEL_NUMBER_2,
    3,CONTROLLER_MODEL_NUMBER_3,
    4,CONTROLLER_MODEL_NUMBER_4
    ) as CONTROLLER_MODEL_NUMBER
    ,DECODE(rn,1,TRIM (UPPER (serial_number_1)),
    2,TRIM (UPPER (serial_number_2)),
    3,TRIM (UPPER (serial_number_3)),
    4,TRIM (UPPER (serial_number_4))
    ) AS SERIAL_NUMBER
    From Edb_Assets C,
    Edb_Accounts A,
    (Select Rownum Rn From Dual Connect By Rownum <= 4)
    where C.Amid = A.Amid(+)
    AND (
    ( controller_model_number_1 != 'NULL'
    AND Serial_Number_1 != 'NULL'
    OR
    ( controller_model_number_2 != 'NULL'
    AND Serial_Number_2 != 'NULL'
    OR
    ( controller_model_number_3 != 'NULL'
    AND Serial_Number_3 != 'NULL'
    OR
    ( controller_model_number_4 != 'NULL'
    AND Serial_Number_4 != 'NULL'
    OR
    ( controller_model_number_5 != 'NULL'
    AND Serial_Number_5 != 'NULL'
    and c.sales_order_number = '1000179'
    order by c.sales_order_number
    The above query works perfect but one extra null row is getting populated because of not adding the cross join . Please help me in adding the cross join
    Thanks
    Sudhir

  • Merging different values into one column

    Hi all,
    If my report has two columns A and B. For one value of A, there are multiple values coming from database for B.
    So, report displays them like this:
    A     B
    1     x
    1     y
    1     z
    Is it possible somehow that i can merge all possible values of B in one row instead of many. i.e. report should look like this:
    A     B
    1     x,y,z
    Please reply with your suggestions.

    Hi,
    It is possible that can merge all B column values in one row.
    Steps:-
    1. First you create an object for B using @aggregate_Aware() function like
    @Aggregate_Aware(TableName.B,TableName.B)+', '
    Object qualification should be measure. Here B is the column name.
    2. In WebI report drag and drop A and B objects
    3. Run the report
    Now you will get the result.
    Edited by: Swarna K on Mar 11, 2011 5:27 AM
    Edited by: Swarna K on Mar 11, 2011 7:20 AM

  • Sql loader - mutiple values into one column

    Hi,
    Is it possible to load multiple fields into one column. Eg, my table structure has two columns COL1, COL2 and my data file is comma delimted with 3 fields A,B,C.
    How could i use sql loader to achieve (without the use of temp tables)
    COL1 = A
    COL2 = BC
    Thanks

    I don't understand why you can't modify the input fille.
    But anyway, i have 2 ways to help you
    1. Make new inputfile online using pipe and awk(or something your are familiar with) and use it as new input file.
    This is a traditional and powerful method in Unix environment.
    For instance:
    oracle> $ mknod pipe.dat p
    oracle> cat input.dat | awk '{print ...}' > pipe.dat &
    oracle> sqlldr ctl=.. data=pipe.dat
    Using this method, you don't need to modify original input file physically, but by some magical trick you can modify it on the fly.
    2. Use before trigger
    For instance:
    create table load(a int, b int, c int, d int);
    create or replace trigger load_trigger
    before insert on load
    for each row
    begin
    :new.d := :new.b + :new.c;
    :new.b := null;
    :new.c := null;
    end;
    load data
    infile *
    append
    into table load
    fields terminated by "," optionally enclosed by '"'
    (a, b, c)
    begindata
    1, 1, 1
    2, 2, 2
    3, 3, 3
    4, 4, 4
    sqlldr userid=... ctl=load.ctl
    SQL> select * from load;
    A B C D
    1 2
    2 4
    3 6
    4 8
    You won't like the existence of unnecessary columns(B, C) but don't have choice. ^^;
    I think there is another simple way provided by SQL*Loader. But i've never tried it myself. Read following doc and try it yourself:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1008153

  • Combining Multiple occurrencesof the same field value into one and Sum prob

    Hi
    I am trying to combine the multiple occurrences of the field values and sum the amount to the target
    Source
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>15</Amount1>
    <Amount2>15</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    </Record>
    Target
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>25</Amount1>
    <Amount2>25</Amount2>
    </Item>
    </Record>
    I am using MM at present. All fields are KeyFields here. Should check against each other.
    I followed Context setting to the Root Item and Sort, SplitByValue and CollapseContext to achieve the functionality.
    But it checks against each field and not all fields. So either one field has different value, only that perticular field gets into New Node and not the entire record. In this case, i might need UDF i guess. Any UDF help is much appreciated
    Bad Target example of what i am getting
    Source
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>15</Amount1>
    <Amount2>15</Amount2>
    </Item>
    <Item>
    <Item1>2</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    </Record>
    Target
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>25</Amount1>
    <Amount2>25</Amount2>
    </Item>
    <Item>
    <Item1>2</Item1>
    </Item>
    </Record>
    In the above scneario, only Item1 returns the value into different node. But i like to have entire node values into the record, if one value changes in the entire record.
    Appreciate your help with the UDF in advance
    </Record>

    I think you are looking for string aggregation.
    The following are the replies posted by me in the forum recently on the same case.
    they might help you.
    Re: Concatenating multiple rows in a table - Very urgent - pls help
    Re: Doubt in a query ( Urgent )
    Re: How to remove words which consist of max 2 letters?
    Re: output like Name1,Name2,Name3...

  • How to combine data from two rows into one row

    I have the following sets of data. I want to find all the duplicate sets of field values. in the data below there is only one duplicate set: brenda, analyst, green.
    DocID and Doc Seq combine to form the set key. FieldID I believe are consistent in that 1 is always name, 2 is job, 3 is favorite color etc. but there are up to 20 field IDs.
    To tell you the truth, my client is a bit sketchy about the data and the values. I would like collapse the sets by getting all the field values into a single row. They could be in the same column, or in their own columns. This way I can then look for whatever
    dups my customer seems to think that he has.
    the first image is what i want (either in same column or in different columns. but they have to be in the order of the FieldID), the second is what i have. THANKS

    CREATE TABLE #t (
    c1 INT NOT NULL PRIMARY KEY,
    c2 VARCHAR(50) NOT NULL
    GO
    INSERT INTO #t(c1, c2) VALUES(1, 'P1,P2,P3')
    INSERT INTO #t(c1, c2) VALUES(2, 'P2,P3')
    GO
    -- Generate set of numbers
    -- Idea from Itzik Ben-Gan
    ;WITH
    L0 AS (SELECT 1 AS n UNION ALL SELECT 1),
    L1 AS (SELECT 1 AS n FROM L0 AS a, L0 AS b),
    L2 AS (SELECT 1 AS n FROM L1 AS a, L1 AS b),
    L3 AS (SELECT 1 AS n FROM L2 AS a, L2 AS b),
    L4 AS (SELECT 1 AS n FROM L3 AS a, L3 AS b),
    Numbers AS (SELECT ROW_NUMBER() OVER(ORDER BY (SELECT 1)) AS Number FROM L4)
    SELECT
    t.c1,
    t.c2,
    SUBSTRING(',' + t.c2 + ',', Number + 1, CHARINDEX(',', ',' + t.c2 + ',', 
    Number + 1) - Number - 1) AS Item,
    ROW_NUMBER() OVER(PARTITION BY t.c1 ORDER BY n.Number) AS rn
    FROM
    #t AS t, Numbers AS n
    WHERE
    n.Number <= LEN(t.c2)
    AND SUBSTRING(',' + t.c2 + ',', n.Number, 1) = ','
    ORDER BY
    t.c1, rn
    GO
    DROP TABLE #t
    GO
    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

  • Combine songs of 2 albums into one

    I have songs from 1 album separated into 2 albums in itunes. How can I combine these into one? Thanks.

    Hi,
    917372 wrote:
    Thanks for the quick response - that works great thanks.
    That "dual" table is oracle specific though right?Right; don't expect a dual table in a non-Oracle database.
    I know this an oracle forum, but just out of curiosity would there be a quick non-oracle way to do this as well?Other databases may have their own specific ways of doing something similar. In SQL Server (I believe) you can simply omit the FROM clause.
    If all else fails, create your own 1-row table. You can call it dual, if you want to.
    CREATE TABLE  dual
    (   dummy   VARCHAR2 (1)
    INSERT INTO dual (dummy) VALUES ('X');
    COMMIT; 
    FULL OUTER JOIN doesn't use dual:
    SELECT     *
    FROM           (SELECT col1 FROM tblA WHERE col1 = 'val1') a
    FULL OUTER JOIN  (SELECT col2 FROM tblB WHERE col2 = 'val2') b  ON  1 = 1
    ;Edited by: Frank Kulash on Feb 27, 2012 8:34 PM
    Added FULL OUTER JOIN

Maybe you are looking for

  • Solaris 2.8 on Intel Installation Problem

    When attempting to install Solaris on Intel 2.8, everythin g goes fine and the files are copied, but it fails at the end with the following message: Customizing system files - Mount Point table (etc/vfstab) - Network host address (etc/hosts) Error: C

  • How do I delete more than one but not all emails at once?

    I don't want to have to click on or check mark 6K emails individually to erase them all. This seem like a most basic feature element. Can it be done efficiently? or at all?

  • Smart Objects rendered incorrectly in CS6

    Here is a logo, pasted as a smart object from Illustrator into Photoshop CS5.1 : Here is the same logo pasted as a smart object from Illustrator to Photoshop CS6: Note the gaps in the orange gradient at the top of the graphic, and the transparent are

  • How to get pattern from the string?

    Friends, I have 3 strings variables. Name1,Name2 and Name 3. I want to search following terms in above variables. 'T1' 'TURC1' 'TURC 1' and 'TURC 1X'  " X=any character 'T2' 'TURC1' 'TURC 2' and 'TURC 2X'  " X=any character 'T3' 'TURC1' 'TURC 3' and

  • Creating reports using oracle application server

    Hello All, I am a complete newbie with Oracle Application Server(OAS) and Oracle reports. My task is to generate HTML and PDF reports using OAS. The current application has a aspx pages(ASP.NET as front end) which calls a third party tool Fast Radar