6 Replies Latest reply: Jul 31, 2012 4:12 AM by Richard Pressanti

# basic question

Hi all,

I have a basic question -- I'm trying to multiple a sum with a single value.

For instance:

-I have a table with multiple unit sales entrances per SKU

-Another table has a single value for the price of each SKU

Table A:

SKU A     4

SKU A     6

SKU A     10

Table B:

SKU A     \$2.00

I'm trying to do (sum(table A))*(value(table B)), as the answer would be \$40.00 for SKU A in this case.

How would I value up each SKU?

Cheers,

F.

• ###### Re: basic question

Are you trying to do this in a chart or in the script?

-Rob

• ###### Re: basic question

It's not a chart. So it's in the script, I suppose.

• ###### Re: basic question

Which chart are you using or you do it in script?

• ###### Re: basic question

It's not a chart. So it's in the script, I suppose.

• ###### Re: basic question

HI,

Try like this,

TableA:
[
Name1,Value
SKUA,4
SKUA,6
SKUA,10
];

join(TableA)
[
Name1,Total
SKUA,2.00
];

TableB:
Load Name1,Total,Sum(Value) as TotalValue Resident TableA Group by Name1,Total;

TableC:
Load *,(TotalValue * Total) as ExpectedValue Resident TableB;

Drop tables TableA,TableB;

• ###### Re: basic question

Table_B :