Forum Discussion

Sudharshan1919's avatar
Sudharshan1919
Helper III
3 years ago

Calculated Column Result

Hi All,

 

Below are my Tables and its data

 

Table1

S.No   PricingModel   Cost       meterName   Quantity

1         Reservation      0            D4s V3              24

2         Reservation      0            D4s V2              24

3         Reservation      24023    D8s V4              15

4         OnDemand      34567    D4s V2              20

5         OnDemand      94890    D4s V4              36

 

Table2

S.No   PricingModel    meterName   HourPrice

1          Reservation       D4s V3           2.56

2          Reservation       D4s V2           3.67

3          Reservation       D16s V3        7.89

 

Now, my calcultion in Table1 what i need is 

If the Table1[Pricing Model] = Reservation and Table1[Cost] = 0, then the value in a new calculated column must be Table1[Quantity]*Table2[HourPrice] else it must give the as it is cost value. and for the OnDemand also it must give the respecitve value which is present in Table1

 

Below must be the output of my above query in Table1

Table1

S.No   PricingModel   Cost       meterName   Quantity    FinalPrice

1         Reservation      0            D4s V3              24              61.44

2         Reservation      0            D4s V2              24              88.08

3         Reservation      24023    D8s V4              15              24023

4         OnDemand      34567    D4s V2              20              34567

5         OnDemand      94890    D4s V4              36              94890

 

Here FinalPrice is the calculated Column that is needed for me now.

Someone please help me on the above conition.

 

Thanks