Newbies nevhornsey Posted October 11, 2006 Newbies Posted October 11, 2006 I have a set of fields which I am trying to get totals from. The idea is to add up how many prints are created at a certain size and price and then have a total cost. The size and prices are as follows A4 @ £25 A3 @ £50 A2 @ £75 so if there were 10 * A4 prints I would charge £250 At the moment I have a drop down menu for the size of prints in one field, a total number of prints in the next field and now I just need the total to be calculated based on what's in those fields. i feel that the drop down menu may be causing too many problems but it is the neatest way of displaying the info, I just don't know how to set the different variables in the calculation. any help would be appreciated
John Mark Osborne Posted October 11, 2006 Posted October 11, 2006 Case( size = "A4"; 25; size = "A3"; 50; size = "A2"; 75 ) * NoPrints
comment Posted October 11, 2006 Posted October 11, 2006 Generally, it's not a good idea to store prices in a calculation formula. When prices change (as they invariably do), your entire history is messed up. You should have a table of prices, and lookup the price from there, based on the selected product/service. Then your calculation becomes Price * Quantity.
Newbies nevhornsey Posted October 12, 2006 Author Newbies Posted October 12, 2006 (edited) I have decided to put my prices in seperate tables an d I will look them up. The calculation from the previous reply looked very neat though. As I look at it, does putting anything in " " mean that calculated part is processed and the " " is only displayed? how does my calculated field know where to find " " ? Also I looked for examples of calculations relating to similar circumstances. I found a sales ledger and inventory on two tables. the end result is the same to what I need. I have basically set out my tables in the same way as the example and I have an equation that works :: If( IsEmpty( Product Quantity ) ; 1 ; Product Quantity ) * Product Unit Price If someone could break it down into lame english so I could understand why the equation is laid out this way I may not need to ask any more questions in the future. It looks to simple to be hard to understand but I just don't get 'If' or 'IsEmpty' or why there would be ' ; 1 ; ' in the middle Edited October 12, 2006 by Guest needed to ask more questions
Søren Dyhr Posted October 12, 2006 Posted October 12, 2006 As I look at it, does putting anything in " " mean that calculated part is processed and the " " is only displayed? Carefull here! NO! - The quotes means that the type is text and not interger ...when John put quotes around "A4" is he comparing strings of text with each other! --sd
Recommended Posts
This topic is 6679 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now