question

Nerdio-0721 avatar image
0 Votes"
Nerdio-0721 asked Nerdio-0721 edited

Calculate a Measure using a constant from an unrelated table

I have written a measure that calculates the volume of a number of items for an order. I now want to write a measure that would calculate how many cartons would be needed for that order. There are three carton sizes which I have defined in a separate, but unrelated table. In essence the calculation would be

NumberOfSmallCartons:=TotalVolume/SmallCartonVolume
NumberOfMediumCartons:=TotalVolume/MediumCartonVolume
NumberOfLargeCartons:=TotalVolume/LargeCartonVolume

The Carton Volume Table is something like this;

Small,90000
Medium,125000
Large,200000

I need to be able to reference the Carton Volume Table by creating a 'temporary' relationship by virtue of 'Small', 'Medium', or 'Large'.

Or do it a better way.

Any advice/suggestions would be appreciated. Thanks

office-excel-itpro
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Nerdio-0721. Re. Any advice/suggestions would be appreciated:
- Provide feedback (i.e. Accept as answer if applicable) on your previous case - this might motivate contributors...
- Upload a couple of pictures showing the structure of your tables - this will clarify things


1 Vote 1 ·

This is not a PQ question. Fixing tag.

0 Votes 0 ·

@Nerdio-0721
Could you please share us a simple sample for better analysis?
Thanks for your understanding.

0 Votes 0 ·

I don't have an example, though could create one. So maybe take this as a simple matter of this.

I have a calculated column which gives me a Volume (Total Volume)

I have a separate table which is, if you like, just parameters. This tells me the volume of a Small Carton, Medium Carton and Large Carton. This would be something like this in structure.

Small; 90,000
Medium; 125,000
Large; 200,000

If I wanted to create a measure to know how many times each of the Small, Medium and Large volumes divided into the Total Volume, then how could I reference the table with the Small, Medium and Large volumes in?

0 Votes 0 ·

@Nerdio-0721
You may use LOOKUPVALUE to look up the value of Small, Medium and Large numbers.

0 Votes 0 ·
Show more comments

1 Answer

HerbertSeidenberg-6295 avatar image
0 Votes"
HerbertSeidenberg-6295 answered

This is a typical Knapsack problem
with possibly thousands of solutions,
depending on the exact input parameters.
See Wikipedia.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.