# Creating Price Forecast and Calculation in Calculation Fields Based on Field Content in Frontend

I have a desire to be able to create a price and calculation via the frontend in calculation fields. Below are data for 'Organisation Level 4' and 'Visited time.' I would like to be able to create a forecast of expected billing if I could specify an average price per 'Organisation Level 4.'?

Org Niv 4 Price
HJP Nord 385

HJP Syd 390

HJP Vest 370

HJP Øst 375

• Hi Lars, you can try this:

In my example, Casual Clothing Retail (d1) was calculated *1,1 and Calsual Cloting Wholesale (d2) was calculated with 1,2.

My formula is:

if allcount(d-1, d1:0, m1) = 1 then sum(d-1, d1, m1) * 1,1

else if allcount(d-1, d1:0, m1) = 2 then sum(d-1, d2, m1) * 1,2

else 999

• Hi Marlene.

Thank you for the creative suggestion, which, of course, means that I need to figure out in which positions the individual organizations are displayed.

I've tried updating my small sheet with sample data and can see that it's also multiplying on the total. It has also done that in your example, where the total is not the sum of Retail and Wholesale, but instead Total x 1,1. Is there any way to fix that?

• Thank you for the great suggestions :-)

I will work on them further.

Happy New Year

• If you can't be sure of the position of a certain dimension member, you may also use a modified version of Marlene's suggestion:

`if allcount(d-1, d1:0, m1) = allcount(d-1, d1:@"[HJP Nord]", m1) then sum(d-1, @"[HJP Nord]", m1) * 1,1else if allcount(d-1, d1:0, m1) = allcount(d-1, d1:@"[HJP Øst]", m1) then sum(d-1, @"[HJP Øst]", m1) * 1,2else 999BR / Ole`
• Thanks a lot, Ole - I will try this :-)

Best regards / Lars