Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: Applymap not working with equal values.

What exactly you want ?

Unclear from your question.

Not applicable

Re: Applymap not working with equal values.

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

Re: Applymap not working with equal values.

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

Re: Applymap not working with equal values.

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

Re: Applymap not working with equal values.

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

Not applicable

Re: Applymap not working with equal values.

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

Re: Applymap not working with equal values.

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.

Community Browser