Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
slribeiro
New Contributor III

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
Highlighted
tyagishaila
Valued Contributor

Re: Problem with calculations of costs and sells

share sample data.

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

Highlighted

Re: Problem with calculations of costs and sells

How does your model look like?

Highlighted

Re: Problem with calculations of costs and sells

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

Highlighted

Re: Problem with calculations of costs and sells

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*';

Highlighted
dusasuman
Contributor

Re: Problem with calculations of costs and sells

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

Highlighted
MVP
MVP

Re: Problem with calculations of costs and sells

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