
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to Append Values between Two or More Columns
Hi,
I am trying to get the the values from two different one-column tables merged or appended under one column. I tried Contcatenate, Joins, and other functions. It did not work. I am trying to get help from this forum.
There are situations:
Situation A:
Data1:
Load * Inline
[Customer1
A
B
C
D
];
Data2:
Load * Inline
[Customer2
E
F
G
H
A
B
C
];
I want to merge the above two tables. The values in Customer2 table must append the values in Customer1 table. The final result must look like this.
Customer |
A |
B |
C |
D |
E |
F |
G |
H |
A |
B |
C |
Situation 2:
Table1:
Load
if(condition=TRUE, ValueA) As Field1,
if(condition=TRUE, ValueB) As Field2,
if(condition=TRUE, ValueC) As Field3,
if(condition=TRUE, ValueD) As Field4,
Resident SampleTable;
How do I get all the values in each separate fields to be appended to each other. The final result must append all the 4 values under one column, and must look like this:
AllValues |
ValueA |
ValueB |
ValueC |
ValueD |
I appreciate any assistance.
Thanks,
Raghu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The name of the columns have to be the same, see table2 is Customer1 as well
Data1:
Load * Inline
[Customer1
A
B
C
D
];
concatenate(Data1)
Data2:
Load * Inline
[Customer1
E
F
G
H
A
B
C
];
Table2:
load
Concat(if(Customer1='A' or Customer1='B' or Customer1='C', Customer1)) as ValueA,
Concat(if(Customer1='D' or Customer1='E' or Customer1='F', Customer1)) as ValueB,
Concat(if(Customer1='G' or Customer1='H', Customer1)) as ValueC
Resident Data1;
DROP Table Data1;
Regards,
Oscar


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In your first case how would you know if the first A is for cust 1 or 2?
This is against principle rule that the table should have only unique values.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
try this:
Situation A:
Data:
Load * Inline
[Customer
A
B
C
D
];
Load * Inline
[Customer
E
F
G
H
A
B
C
];
Situation 2:
Table1:
CrossTable(Description,AllValues,1)
Load 1 as tmp,
if(condition=TRUE, ValueA) As Field1,
if(condition=TRUE, ValueB) As Field2,
if(condition=TRUE, ValueC) As Field3,
if(condition=TRUE, ValueD) As Field4,
Resident SampleTable;
drop fields tmp, Description;
Hope it helps
Regards
MR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Oscar,
Thanks for your response. It seems my question may not have been as clear. I will repost this again with more explanation. But your response partially helped me understand some QlikView load scripts.
Thanks,
Raghu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MR,
Thanks for your response. It seems my question needs more elaborate explanation. But your response partially helped me understand some QlikView load scripts.
Thanks,
Raghu


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are your other doubts or requires?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MR,
I posted another question that is related to this one in QlikView Community.
How to Concatenate values in different columns into One Column
Thanks,
Raghu


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I read that Sunindia gave you the answer. There's anything else I could do for you?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MR,
At present I am fine. Thank you for asking.
Thanks,
Raghu
