Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Please advice me to concat the records.
find my data and expected output below
My Data
ID | Name | Attribute |
101 | Venkat | High |
102 | Satish | High |
102 | Satish | Low |
103 | Suresh | High |
104 | Ram | Low |
105 | Kavya | High |
105 | Kavya | Low |
105 | kavya | Medium |
106 | Ravi | |
106 | Ravi | High |
106 | Ravi | Medium |
107 | kavya | Medium |
Expected Output:
ID | Name | Attribute |
101 | Venkat | High |
102 | Satish | High,Low |
103 | Suresh | High |
104 | Ram | Low |
105 | Kavya | High,Low,Medium |
106 | Ravi | High,Medium |
107 | kavya | Medium |
Thanks in advance.
Durga
Sample script
Table:
LOAD ID,
Name,
Concat(If(Len(Trim(Attribute)) > 0, Attribute), ',') as Attribute
Group By ID, Name;
LOAD * INLINE [
ID, Name, Attribute
101, Venkat, High
102, Satish, High
102, Satish, Low
103, Suresh, High
104, Ram, Low
105, Kavya, High
105, Kavya, Low
105, kavya, Medium
106, Ravi,
106, Ravi, High
106, Ravi, Medium
107, kavya, Medium
];
May be like this
LOAD ID,
Name,
Concat(Attribute, ',') as Attribute
FROM....
Group By ID, Name;
Sample script
Table:
LOAD ID,
Name,
Concat(If(Len(Trim(Attribute)) > 0, Attribute), ',') as Attribute
Group By ID, Name;
LOAD * INLINE [
ID, Name, Attribute
101, Venkat, High
102, Satish, High
102, Satish, Low
103, Suresh, High
104, Ram, Low
105, Kavya, High
105, Kavya, Low
105, kavya, Medium
106, Ravi,
106, Ravi, High
106, Ravi, Medium
107, kavya, Medium
];
Perfect!. Its working.....
One minor issue found in my original application. few values are showing as blanks instead " - ". Some are showing - values. I guess blank values are null values.
How to achieve this?
How to achieve what? I am not sure I understood the issue
Hi Sunny,
Sorry for delay response. Please find the sample application.
I have used straight table as required in my original application.
I have added one record in the sample applicaton and reloaded. when we export table to excel from front end, I am expecting - symbol for the record Hari (108).
Please advice.
hanks,
Like this?
Thanks Anil.
It's working.. I tried in wrong way.