Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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?
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
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
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.