Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
My requirement is I have two fields X,Y. X field has values A,B and Y field has value C..now I want to create a new field Z with values A,B,C. My intention is to create graphs on combined values A,B and C.
Any help is highly appreciated.
Hi
Try like this
Test:
LOAD * Inline
[
X,Y
A,C
B,C
];
Load SubField(Z,',') as Z;
LOAD X&','&Y as Z Resident Test;
Hi
not clear, how is your data file ? can you put an example.
JJ
X,Y,Z are from same table?
Hi Mayil
1. Your result will have duplicates if both the field has same values or value appears more than once.
2. Why you need to combine and then separately need to apply subfield over it?
Simply you can do this right?
Test:
LOAD * Inline
[
X,Y
A,C
B,C
];
LOAD Distinct SubField(X&','&Y,',') as Z Resident Test;
X,Y columns are from spreadsheet...
these columns are coming from excel
Hi
Test:
LOAD X,Y from filename.xls;
LOAD Distinct SubField(X&','&Y,',') as Z Resident Test;
is not work as you expected?
Thank you Mayil Vahanan Ramasamy , i think your solution worked..but in 2nd column there are various value I want to extract only particular value C..consider example two columns State and region
Ca West
NY East
TX South
I need new column Z with values
CA
NY
TX
West..
so, if put the where condition in 2nd column
LOAD Distinct SubField(X&','&Y,',') as Z Resident Test
where Y='West' I'm getting only two values for Z
CA
West
any help is highly appreciated..
Use Simply as
Table1:
Load State,Region,State as NewField
from excelSource;
Load * Inline [
NewField
West
];
Edit:
If you need Regions under State starts with c then
Load State as NewField
Resident
Table1 Where WildMatch(State, 'C*');
Hope it helps