Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
apthansh
Creator
Creator

Merging 2 columns in qlikview

I have 2 tables as below

Table 1 :

ID     Category                Cost

1       NewsPaper            800

2       Magazines             9000

3       Journal                   800

Table 2:

ID      Type                           Cost

1        E-Newspaper             500

2        E-Magazine                800

3        E- Journal                   600

In chart I want to use Category and Type as dimension.Here I dont want to concatenate 2 columns instead I want to merge these 2 columns.How can I do that in chart level instead of script level concatenation ?

Thank you very much.

4 Replies
vishsaggi
Champion III
Champion III

What you mean by merging? What is your expected output to look like, can you send us some kind of a screen shot?

Is this what you are expecting?

Capture.PNG

apthansh
Creator
Creator
Author

No...

I am expecting the o/p as below

ID     Type                           Cost

1       Newspaper               800

1       E-Nwespaper           500

2       Magazine                 9000

2       E-Magazine               800

3       Journal                      800

3       E-Journal                  600

can I do this in chart level instead of concatenating in script level

vishsaggi
Champion III
Champion III

Try this? Just change the Field name Type to Category, then use straight table. Qlikview will do it automatically.

Table1:

Load * INLINE [

ID,     Category,      Cost

1,       NewsPaper,  800

2,       Magazines,  9000

3,       Journal,    800

];

Table2:

LOAD * INLINE [

ID,      Category,       Cost

1,        E-Newspaper,500

2,        E-Magazine ,800

3,        E- Journal ,600

vishsaggi
Champion III
Champion III

If you dont want to change any of your fields or table structure, you will get synthetic keys in your data model. Are you ok with that? If Yes, then just load your tables as shown in your question.

Add straight table.

Dim: = ID,

        = IF(Len(Trim(Category)) = 0, Type, Category)

Expr: = Sum(Cost)

You should get this.

Capture.PNG