Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenate on several fields not work

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

19 Replies
PrashantSangle

Hi ,

Try like this

Table_A:

LOAD *[Field

KEY        

YEAR       

WEEK

YWEEK

];


Concatenate

LOAD *[Field

KEY       

YEAR       

Num(Num#(WEEK)) as WEEK,

YWEEK

];

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

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.

Not applicable
Author

Make sure Datatype of fields in both the tables are same. If not convert it to same data type.

Not applicable
Author

Yes...

Can you please share the values for the WEEK field in Table A?

PrashantSangle

Hi,

for converting text to Num

use Num#() and Num()

like NUM(NUM#(FieldName,'00'),'00')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

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

sasiparupudi1
Master III
Master III

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;

timanshu
Creator III
Creator III

Can you upload screenshot of fields creating problem from both tables fetched separately(no concatenation), using table viewer.?

Not applicable
Author

Hi Max

Sorry for late reply.

Wow it solved my problem Max,

Thanks for your help

Regards,

Indra

PrashantSangle

Welcome

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂