Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Applymap not working with equal values.

Hi guys,

I have a small table and a Qlikview that uses apply map in the script. Items E and G are "fish", and both have the Classifications. So, in my .qvw file, this is not shown.

Is there a way out of this situation in this case?

item_idFood_nameFood_PriceClassificationClassifications
1hamburguer10unhealthy
2ice cream11unhealthy
3steak12unhealthy
4bread13healthy
5coke14unhealthy
6juice1healthy
7green salad2healthy
8mango3healthy
9ham15healthy
10cesar salad16unhealthy
11chicken8healthy
12fish8healthy
13tofu5healthy
Ajuice0.5healthycoke
Bgreen salad1.5healthycesar salad
Cmango2.5healthyice cream
Dchicken7healthyhamburguer
Efish7healthyhamburguer
Ftofu4healthyhamburguer
Gfish10healthyhamburguer
7 Replies
MK_QSL
MVP
MVP

What exactly you want ?

Unclear from your question.

Not applicable
Author

item_id = E and item_id = F are not shown in the dashboard in the "Food Price" table, inside the blue box called "Healthier Choices", I want those items to appear.

Not applicable
Author

That table is trying to pull in the Food_Price_substitute field from your Menu-1 table. There are 2 "fish" records in that table that are identical except for Food_Price_substitute, so the chart does not know which price to use.

ScreenClip.png

When this happens, QlikView inserts a null as it doesn't have the context necessary to complete the chart. You have nulls and zero values suppressed on this chart object (on the Presentation tab), so these rows are left out.

Not applicable
Author

Is there a way of avoiding it, or as long as the names is the same, the problem will continue?

Is there a way of making this ApplyMap works using the item_id as key, so it doesn't mess with the names being the same?

Not applicable
Author

Clark, can you tell me if there is a way out of this?

Not applicable
Author

Julio,

Yes, you could use the item_id with applymap.

These records need to be unique in some way. If you were calculating this manually, how would you know what price to use for fish? I would recommend giving each of these fish items a different item_id since they have different prices and then using item_id when mapping.

Not applicable
Author

I managed to solve this problem by doing a different thing. I moved "Food_Price_substitute" as a third dimension, instead of leaving it as an expression.

But thank you very much, it helped me.