Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
slribeiro
Partner - Creator
Partner - Creator

Problem with calculations of costs and sells

Greetings, i wonder if you could help me solve my problem here...

I have a pivot table where i have the following result:

file1.png

What i would like to have it should be something like this...

Screenshot_1.png

Basically, i'm having problems on the association of the values by the name because the values aren't directly associated in the model.

Hope you can help me

Best regards, Simão Ribeiro

6 Replies
tyagishaila
Specialist
Specialist

share sample data.

are component1....... component6 values present in both dim1 and dim2?

robert_mika
Master III
Master III

How does your model look like?

Kushal_Chawda

I think your data is not consistent. May be you need to change your data model. Dim2 dimesion is not associated with cost value.

avinashelite

Try like this

Temp:

Mapping LOAD

dim1,

costvalue

from table where

dim1 like 'component*';

Result:

LOAD dim1,

dim2,

Applymap('Temp',dim2) as costvalue,

sellvalue;

from table

dim1 like 'product*';

dusasuman
Creator
Creator

Looks like Your Model is not linked properly.  Please check the same.

jonathandienst
Partner - Champion III
Partner - Champion III

During the load, you could build a mapping table for the cost values for the components and then use ApplyMap to assign the costs to the products.

Another option would be to load the components with their costs in a separate table and associate the components to the products via the component ID. Then in a table using the products (and optionally the components) as dimensions, you could simply sum the costs.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein