3 Replies Latest reply: Oct 25, 2016 2:01 PM by Saran De

# how to calculate values of by a range

Hi techi

i have two table

Table1:

 Product Quantity Sold A 5 A 10 A 5 B 5 B 10 B 5

Table 2:

 Product Start End Price A 1 3 100 A 4 15 110 A 16 30 120 B 1 3 160 B 4 15 200 B 16 30 210

and my output should be like this

 Product Quantity Sold Price A 5 520 A 10 1100 A 5 600

This is how i am calculating first 5 quantity sold the total price is 520rs

(3*100)+(2*110) = 520

• ###### Re: how to calculate values of by a range

May be this?

Table:

AutoNumber(RecNo(), Product) as Flag;

LOAD RecNo() as SNo,

Product,

[Quantity Sold],

1 as Quantity

FROM

(html, codepage is 1252, embedded labels, table is @1)

While IterNo() <= [Quantity Sold];

Left Join (Table)

Start + IterNo() - 1 as Flag,

Start,

End,

Price

FROM

(html, codepage is 1252, embedded labels, table is @2)

While Start + IterNo() - 1 <= End;

• ###### Re: how to calculate values of by a range

Thanks sunny its great i have understanded it nicely

• ###### Re: how to calculate values of by a range

A small thought

AutoNumber(RowNo(), Product) as Flag,

RecNo() as SNo,

Product,

[Quantity Sold],

1 as Quantity