Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Demension

I'm trying to create a field "Take Rate" that is the sum of the number of parts sold/sum of the number of vehicle sold. As of right now, the take rate field is the sum of the each part sold. Is there anyway to reference another table to use as the denominator or is there anyway to reference the max value in the take rate field I currently have?

1.PNG

1 Solution

Accepted Solutions
sonkumamon
Creator
Creator

I don't know how your model is constructed, but for example you can create an aggregate table for the sum of parts sold to create the Take Rate Field.

For example:

Take_Rate:

LOAD

    ProductHierachyID,

    MaterialID,

    SUM(SoldParts) AS TakeRate

FROM Products

GROUP BY  ProductHierachyID, MaterialID

;

View solution in original post

12 Replies
vishsaggi
Champion III
Champion III

May be this:


= Max(TOTAL Sum(number of parts sold) / (sum of the number of vehicle sold))

Not applicable
Author

I'm trying to reference the max in the Take Rate field and use it as the denominator in another calculated dimension maybe? Is there anyway to do this? Or is there anyway to reference another table within a calculated dimension? I've looked into the aggr function and creating variables but haven't been able to figure this out.

vishsaggi
Champion III
Champion III

Can you give me some sample data and your expected output? It will be easy to work on..

sonkumamon
Creator
Creator

Hi Brett

The Take Rate field is calculated within the chart or in the load script?

Not applicable
Author

As of now it is calculated within the chart

Not applicable
Author

What would be the syntax to put it into the load script?

Not applicable
Author

File is uploaded to original post

vishsaggi
Champion III
Champion III

will look into it once i go home.

sonkumamon
Creator
Creator

I don't know how your model is constructed, but for example you can create an aggregate table for the sum of parts sold to create the Take Rate Field.

For example:

Take_Rate:

LOAD

    ProductHierachyID,

    MaterialID,

    SUM(SoldParts) AS TakeRate

FROM Products

GROUP BY  ProductHierachyID, MaterialID

;