Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning,
I've a question about the data reload in Qlikview.
I've one data table like this, where there are 2 coloumns "Cod.Modello" and "Descrizione"
Cod.modello | Descrizione |
---|---|
8XFB14 | A1 SB 1.6 TDI SPORT |
8XFCJC | A1 SB 1.4 TFSI DESIGN |
8XFCJG | A1 SB 1.4 TFSI S-TR DESIGN |
8XKAT4 | A1 1.0 TFSI |
8XKA1G | A1 1.6 TDI S-TR |
8XKA14 | A1 1.6 TDI |
8VEARG | A3 CB 2.0 TDI S-TR. |
8VEAR9 | A3 CB 2.0 TDI Q. |
8VEATC | A3 CB 2.0 TDI |
8VFAGY | A3 SB 2.0 TFSI Q.S-TR. |
8VFANC | A3 SB 1.0 TFSI |
8VFANG | A3 SB 1.0 TFSI S-TR. |
8VMAZG | A3 SEDAN 1.5 TFSI S-TR. |
8VMBDC | A3 SEDAN 1.6 TDI SPORT |
8VMBDG | A3 SEDAN 1.6 TDI S-TR.SPORT |
8VMBGC | A3 SEDAN 2.0 TFSI SPORT |
I've a second table where there are 2 coloumns "SIGLA" and "%"
SIGLA | % |
---|---|
8XK | 10 |
8XF | 10 |
8VF | 10,5 |
8VM | 12 |
8VE | 10,5 |
And so the question: Can I've a new table with the merge of this two table like that using the reaload script in Qlikview?
Cod.modello | Descrizione | % |
---|---|---|
8XFB14 | A1 SB 1.6 TDI SPORT | 10 |
8XFCJC | A1 SB 1.4 TFSI DESIGN | 10 |
8XFCJG | A1 SB 1.4 TFSI S-TR DESIGN | 10 |
8XKAT4 | A1 1.0 TFSI | 10 |
8XKA1G | A1 1.6 TDI S-TR | 10 |
8XKA14 | A1 1.6 TDI | 10 |
8VEARG | A3 CB 2.0 TDI S-TR. | 10,5 |
8VEAR9 | A3 CB 2.0 TDI Q. | 10,5 |
8VEATC | A3 CB 2.0 TDI | 10,5 |
8VFAGY | A3 SB 2.0 TFSI Q.S-TR. | 10,5 |
8VFANC | A3 SB 1.0 TFSI | 10,5 |
8VFANG | A3 SB 1.0 TFSI S-TR. | 10,5 |
8VMAZG | A3 SEDAN 1.5 TFSI S-TR. | 12 |
8VMBDC | A3 SEDAN 1.6 TDI SPORT | 12 |
8VMBDG | A3 SEDAN 1.6 TDI S-TR.SPORT | 12 |
8VMBGC | A3 SEDAN 2.0 TFSI SPORT | 12 |
Thankyou.
Nicola
Something like this:
MyMappingTable:
MAPPING LOAD
SIGLA,
%
FROM
...sigla_source..
;
MyTable
LOAD
"Cod.Modello",
"Descrizione"
ApplyMap('MyMappingTable',Left("Cod.Modello",3),0) as %
FROM
...source...
;
Map_SIGLA:
Mapping Load * Inline
[
SIGLA|%
8XK|10
8XF|10
8VF|10,5
8VM|12
8VE|10,5
](delimiter is '|');
T1:
Load
Cod.modello,Descrizione,
ApplyMap('Map_SIGLA',LEFT([Cod.modello],3),'NA') As %
Inline
[
Cod.modello,Descrizione
8XFB14,A1 SB 1.6 TDI SPORT
8XFCJC,A1 SB 1.4 TFSI DESIGN
8XFCJG,A1 SB 1.4 TFSI S-TR DESIGN
8XKAT4,A1 1.0 TFSI
8XKA1G,A1 1.6 TDI S-TR
8XKA14,A1 1.6 TDI
8VEARG,A3 CB 2.0 TDI S-TR.
8VEAR9,A3 CB 2.0 TDI Q.
8VEATC,A3 CB 2.0 TDI
8VFAGY,A3 SB 2.0 TFSI Q.S-TR.
8VFANC,A3 SB 1.0 TFSI
8VFANG,A3 SB 1.0 TFSI S-TR.
8VMAZG,A3 SEDAN 1.5 TFSI S-TR.
8VMBDC,A3 SEDAN 1.6 TDI SPORT
8VMBDG,A3 SEDAN 1.6 TDI S-TR.SPORT
8VMBGC,A3 SEDAN 2.0 TFSI SPORT
];
Did you manage to get this working?
Thanks to both,
but I would also have another question about it. in the example I had not indicated that the field Cod.Modello" have a different number of characters, such as:
SIGLA | % |
---|---|
8X | 10 |
8VF | 10,5 |
8VMA | 12 |
8VMB | 10,5 |
Thankyou.
best regards.
Nicola
Thanks all,
I found this question which is right for me.
http://qlikviewcookbook.com/recipes/download-info/mapping-with-wildcards/
I've tested it and it works correctly.
Best regards.
Nicola