Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a question, i have two tables let's say table A and table B. Table A has 4 fields,
KEY YEAR WEEK YWEEK
... . .... .... ....
Table B also has 4 fields like table A, i want to concate table A with table B. Field KEY and YWEEK from table B successfuly concate to table A, but FIeld YEAR and WEEK from table B not working. do you know the problem ? Really appreciate your help.
Thanks
UPDATE:
When i convert WEEK from table B using "NUM" function, the concate not working. But when i use WEEK as TEXT it's working. But i need to convert WEEK into number format.
Regards,
Indra
Hi ,
Try like this
Table_A:
LOAD *[Field
KEY
YEAR
WEEK
YWEEK
];
Concatenate
LOAD *[Field
KEY
YEAR
Num(Num#(WEEK)) as WEEK,
YWEEK
];
Regards
Hi Indra,
It's is simple, you have to learn date format then it's simple....
Do like this:
Table_A:
LOAD *
KEY,
YEAR,
WEEK,
YWEEK
;
Concatenate
LOAD *
KEY,
YEAR,
Num(WEEK) as WEEK,
YWEEK
;
Ramya.
Make sure Datatype of fields in both the tables are same. If not convert it to same data type.
Yes...
Can you please share the values for the WEEK field in Table A?
Hi,
for converting text to Num
use Num#() and Num()
like NUM(NUM#(FieldName,'00'),'00')
Regards
Hi,
For number formatting we will use like NUM(NUM#(FieldName,'00'),'00')
And for converting the Text to Numeric value we must should specify which one have to convert means Month or week or date etc..
Num(Month(Date)) or
NUM(Week(Timestamp)) or
Num(Date(Today())
Otherwise it will give NULL values
Try
Table_A:
LOAD * Inline [KEY,YEAR,WEEK,YWEEK
1,2002,1,20021
2,2002,2,20022
3,2002,3,20023
4,2002,4,20024
5,2002,5,20025
];
noConcatenate
Table_B:
LOAD * Inline [KEY,YEAR, WEEK ,YWEEK
100,"2002","01",200201
101,"2002","02",200202
102,"2002","03",200203
103,"2002","04",200204
104,"2002","05",200205
];
NoConcatenate
X:
LOAD * Resident Table_A;
Concatenate
LOAD KEY,YEAR,Num(WEEK) as WEEK,YWEEK Resident Table_B;
drop table Table_A;
drop table Table_B;
Can you upload screenshot of fields creating problem from both tables fetched separately(no concatenation), using table viewer.?
Hi Max
Sorry for late reply.
Wow it solved my problem Max,
Thanks for your help
Regards,
Indra
Welcome