Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Mitch_Data
Contributor III
Contributor III

Qliksense Missing Null() values to 0, Applymap?

Hi there, assistance is required! (Fields are Dutch names)

 

The load from below is from a data-warehouse QVD and is the leading data that I have to join on.

dim_Wagenpark:

LOAD distinct
WagenparkID,
"Auto volgnummer",
Kenteken,
Capitalize(Merk) as Merk,
Capitalize(Model) as Model,
// Uitvoering,
Capitalize("Volledige auto omschrijving") as "Auto Omschrijving",
// "Kleur auto",
// "Kleur bekleding",
// Vervoermiddel,
// "Vervoermiddel categorie",
// Gewicht,
// "CO2 uitstoot",
"Kenteken soort (grijs/geel)",
// Inhuur,
// Chassisnummer,
"Datum - Inzetdatum",
// "Datum - Besteldatum",
"Datum kenteken - deel één" ,
// "Datum kenteken - deel drie",
"Datum - Verkoopdatum",
brandstofsoort as Brandstof,
"Brandstof etiket",
"Soort Lease",
Cataloguswaarde,
BPM,
"Catalogusprijs ex BPM/BTW",
"Boekwaarde inzet contract",
"Restwaarde einde contract (incl. BPM/Excl. BTW)"
FROM [lib://QVD Files - 'xx'/1op1 ml_sterschema/ml_dim_Wagenpark.qvd]
(qvd)

Now I have another excel document that I want to join on this data.
However, the excel document has way less data than the load above.

I need to add the field "Werkelijke kosten" to the data above while the key to join on  is"Kenteken".

 

dim_component_446:
LOAD
Kenteken,
"Werkelijke kosten"

FROM [lib://AttachedFiles/Component 446.xlsx]
(ooxml, embedded labels, table is Blad1);

Basically I want field "Werkelijke kosten" added to the first table but since the second table has way less values it will return missing values, because the majority of "Kenteken" can not be linked.

I would like to know if it is possible to assign a 0 for "Werkelijke kosten" if the "Kenteken" can not be matched.
I think that is possible with applymap, but I do not really know how to advance.

 

Thank you very much!

 

 

Labels (5)
1 Solution

Accepted Solutions
Mitch_Data
Contributor III
Contributor III
Author

Managed to solve it:

 

If any of you need the solution see below:

dim_component_446:
MAPPING
LOAD
Kenteken,
"Werkelijke kosten"
FROM [lib://AttachedFiles/Component 446.xlsx]
(ooxml, embedded labels, table is Blad1);


dim_Wagenpark:

LOAD distinct
WagenparkID,
"Auto volgnummer",
Kenteken,
Capitalize(Merk) as Merk,
Capitalize(Model) as Model,
// Uitvoering,
Capitalize("Volledige auto omschrijving") as "Auto Omschrijving",
// "Kleur auto",
// "Kleur bekleding",
// Vervoermiddel,
// "Vervoermiddel categorie",
// Gewicht,
// "CO2 uitstoot",
"Kenteken soort (grijs/geel)",
// Inhuur,
// Chassisnummer,
"Datum - Inzetdatum",
// "Datum - Besteldatum",
"Datum kenteken - deel één" ,
// "Datum kenteken - deel drie",
"Datum - Verkoopdatum",
brandstofsoort as Brandstof,
"Brandstof etiket",
"Soort Lease",
Cataloguswaarde,
BPM,
"Catalogusprijs ex BPM/BTW",
"Boekwaarde inzet contract",
"Restwaarde einde contract (incl. BPM/Excl. BTW)",
Applymap('dim_component_446', Kenteken, 0) as "Werkelijke kosten temp"
FROM [lib://QVD Files - xx/1op1 ml_sterschema/ml_dim_Wagenpark.qvd]
(qvd)

 

View solution in original post

1 Reply
Mitch_Data
Contributor III
Contributor III
Author

Managed to solve it:

 

If any of you need the solution see below:

dim_component_446:
MAPPING
LOAD
Kenteken,
"Werkelijke kosten"
FROM [lib://AttachedFiles/Component 446.xlsx]
(ooxml, embedded labels, table is Blad1);


dim_Wagenpark:

LOAD distinct
WagenparkID,
"Auto volgnummer",
Kenteken,
Capitalize(Merk) as Merk,
Capitalize(Model) as Model,
// Uitvoering,
Capitalize("Volledige auto omschrijving") as "Auto Omschrijving",
// "Kleur auto",
// "Kleur bekleding",
// Vervoermiddel,
// "Vervoermiddel categorie",
// Gewicht,
// "CO2 uitstoot",
"Kenteken soort (grijs/geel)",
// Inhuur,
// Chassisnummer,
"Datum - Inzetdatum",
// "Datum - Besteldatum",
"Datum kenteken - deel één" ,
// "Datum kenteken - deel drie",
"Datum - Verkoopdatum",
brandstofsoort as Brandstof,
"Brandstof etiket",
"Soort Lease",
Cataloguswaarde,
BPM,
"Catalogusprijs ex BPM/BTW",
"Boekwaarde inzet contract",
"Restwaarde einde contract (incl. BPM/Excl. BTW)",
Applymap('dim_component_446', Kenteken, 0) as "Werkelijke kosten temp"
FROM [lib://QVD Files - xx/1op1 ml_sterschema/ml_dim_Wagenpark.qvd]
(qvd)