Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tMap - default value

Hallo,

I have following tMap.



In my output rows in case that the left outer join does not match I do not get the default I have assigned for the columns SeedValue and IncrementValue, instead I get null;
0683p000009MH6n.png

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Got you.
They way I would achieve what you're after is to amend the output mapping: -
row9.SeedValue == null ? 0 : row9.SeedValue
...and you can externalise the default if you wish...
row9.SeedValue == null ? context.defaultSeedValue : row9.SeedValue

"DefaultValue" may or may not work in the way you're after; but I have always found it a troublesome feature and do not use it.

View solution in original post

8 Replies
Anonymous
Not applicable
Author

Hi,
Did you get    zero rows  from your 'lookup' file? Is your match model "Unique Match" or "All match"? (sorry we don't understand this language)
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Sabrina,
I have one row from my lookup. My match model is Unique match.
Best regards, Walter
Anonymous
Not applicable
Author

"In my output rows in case that the left outer join does not match I do not get the default I have assigned for the columns SeedValue and IncrementValue, instead I get null;"
It sounds like your saying that you want to supply a default when the join fails; but your Job does not suggest that you're providing a default.
If you're getting null, then your join is not matching and you have no default being supplied.
Anonymous
Not applicable
Author

Sorry, but I do not understand your answer. As you can see in the picture of my tMap, I have assigned a default value!
Anonymous
Not applicable
Author

wtaus wrote:
Sorry, but I do not understand your answer. As you can see in the picture of my tMap, I have assigned a default value!

I can see a field named DefaultValue on your output schema, which is populated by your driving table. If it is null, then it is because this input data is null.
For the values that come from your look-up table, nothing happens if no look-up match is made, so the corresponding output fields may be null.
If by default, you mean to assign a value when a look-up fails, then I cannot see that from your tMap.
Anonymous
Not applicable
Author

If you look at the screenshot and the output scheme named withidentityinfo, you can see in the bottom right corner, that I have assigned a default for the variables SeedValue and IncrmentValue. However, when my lookup does not provide a match, I do not see these default values in my output row. If the default value for the case that the lookup fails needs to be defined at a different place, then I would be curious to know where I have to define the default instead.
Anonymous
Not applicable
Author

Got you.
They way I would achieve what you're after is to amend the output mapping: -
row9.SeedValue == null ? 0 : row9.SeedValue
...and you can externalise the default if you wish...
row9.SeedValue == null ? context.defaultSeedValue : row9.SeedValue

"DefaultValue" may or may not work in the way you're after; but I have always found it a troublesome feature and do not use it.
Anonymous
Not applicable
Author

modified the output mapping according to your proposal and it works.
Thanks