on 12-25-2014 9:07 AM
Hi all,
I have 2 dimensions: [Title] and [Category]
Title | Category |
---|---|
A | Cat01 |
A | Cat02 |
B | Cat01 |
B | Cat03 |
i want to output as follow:
Title | Category |
---|---|
A | Cat01, Cat02 |
B | Cat01, Cat03 |
How can i achieve this?
Thanks in advance!
Hi,
I come up with another solution.
I made this at universe's level (data foundation).
I created derived table List of categories on data foundation.
SELECT TITLES.TITLE, LISTAGG(CATEGORIES.CATEGORY, ',') WITHIN GROUP (ORDER BY CATEGORIES.CATEGORY) as Categories
FROM CATEGORIES LEFT JOIN TITLES
ON TITLES.MAT_ID = CATEGORIES.MAT_ID
GROUP BY TITLES.TITLE
However, it caused an error "ORA-01489: result of string concatenation is too long"
Anyone know how to solve this error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
anyone help me please!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Danh Chau,
Please find the formula below
Create a variable VAR Max Category =Max([catg])In ([title])
Create a variable [VAR Concat Category] =[catg] +", "+ Previous(Self), to concatenate the category value with it's previous row value
VAR Category==If(IsNull(Previous([VAR Max Concat Category]));Substr([VAR Max Concat Category];1;Length([VAR Max Concat Category])-2);Substr([VAR Max Concat Category];1;Pos([VAR Max Concat Category];Previous([VAR Max Concat Category]))-3))
it worked for me.
even u can follow the below link
bi.scribe: Converting rows into a single cell (comma separated list) in WebI
hope this helps you out!!!
Hi,
I know it is not good idea,have a look if you are interested.
Ex : I have to show plant wise materials in row.
1.Create a cross tab .plant in rows 2 times (1 for section .1 to show) , Material in column and in body
=max([Material] for each([Plant])) .
using any aggregate functions makes your dimension data fit to rows.
Hide top header
2 .Apply section on plant
Hide Material header row
3.delete plant cell .
4.adjust section rows (cell any row ,format table : vertical 0 to top of section)
5.Format cell . make left and right padding's to 0 . Remove borders .you can append ";" if you need.
Final result
Hi Sateesh Kumar,
your solution aims to display 2 columns/dimensions.
In my requirement, I actually have to display more besides the 2 columns above.
Hi,
You can do it like this;
=[Category]+", "+RelativeValue([Category];([Category]);+1)
Regards,
Utku
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.