Jump to content

Bekah

Members
  • Content Count

    127
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Bekah

  • Rank
    member
  1. Thank you Comment! Isn't that what my calc (in my last post) shows? The only difference is that I use Div instead of / and I round it. Hmmm, maybe this is another issue like Queue indicates ... where Div doesn't handle the numbers right like / does. I will try changing my calc by removing the Round and the Div just to see what happens. Thank you! IT WORKED!!! If(ItemType = "Stock"; If(PriceBase = "Retail" ; 100 - (UnitPrice / RetailPrice * 100); 100 - (UnitPrice / WholesalePrice * 100))) Oh! Hmmm, I don't think I like that Div function. It isn't very nice. I'm done! Thank you all for hanging in there with me. I'd have quit long ago without your patient help on it. YAY! I can go play!!
  2. Thank you for the explanation, JT. This last piece I'm stuck on ... I can't always use the Discount field to get the discount because sometimes they manually type the price in but want it to display what that discount percent is, for the customer. So I wanted the LineItem to just auto-enter replace what that discount is (the LineItems display in a portal below). I can get the discount amount but not the discount percent (I have a field in LineItems called Savings). Oh, so close to done. Why is my auto-enter calc (in my last post) wonky? I keep trying to make it work and it just won't. The LineItem auto-enters it and changes it if I change the price, but the percentage displayed is wrong. Please help me on this one. Then I promise I won't bother any of you about discounts EVER AGAIN! But I am still truly stuck on it.
  3. Can you assist one more time Mr. Comment (or anyone that may read this)? The math link tells me what it should be ... sort of. But it tells me what the UnitPrice is to the RetailPrice (or WholesalePrice), NOT the amount of the discount applied. So I figure I have to then subtract this amount from 100, right? I tried many, many formulas. Math link says: Example: 68 is what percent of 87? Divide the first number by the second (e.g. 68
  4. Thank you for the wonderful math link! I also needed to know how to figure a percent when I had two numbers but I was too embarrassed to ask ... after all the trouble with this and it probably being such a dumb question. But this math link has the answer for that too -- 'Determining Percentage'!! I remain unclear on why filter wouldn't work in my script; but I'm very tickled regardless. Thanks again for making my day. Oh, I can't wait to study this math link.
  5. Well, that works but people can type the period (which changes the result alot) or words or %, which is why I was using the filter. But I don't care at this point ... it works and that's enough. I decided to give up on removing the bad characters but then remembered auto-enter and tried it. By unclicking Replace. The auto-enter removes the garbage and the script sets the field right! I changed the discount field to number also so I could remove the unnecessary GetAsNum. I think this was the calc Ugo was suggesting also. Why would it work in auto-enter and not the script? Puzzling to me. I don't know how Queue got that filter calc to work in the script and would love to understand that, but for now I'm going to use this! I will actually be able to work on other things yet this weekend! THANK YOU!!!
  6. Well, I don't know math but I know something is wrong. On 14.15 clicking 50% produces 7.15 and should be 7.05 right?!! On 14.15 clicking 10% produces 13.15 and should be 12.73?? I've attached my test file. Please help me figure out why this isn't working. I'd be forever grateful to anyone to help me. I hate math. test.zip
  7. Hi JT, I changed the process so that clicking the button simply sets the gDiscount field with the script parameter (10, 15 etc). And then Apply Discount button is straight script of: Set Field [ gUnitPrice; gTempPrice - Round( Div( gTempPrice * Filter( gDiscount; "0123456789" ); 100 ); 2 ) I have both gUnitPrice and gTempPrice displayed. Both fields are set number format 2 decimal, although gDiscount is text). Clicking the 10 inserts it into gDiscount. Then clicking the Apply Discount doesn't change gUnitPrice but clicking the other buttons changes it. Is it possible to see your sample file so I can attempt to figure out what is different? Why would it work on every percentage but 10? Otherwise, I'll have to change the calc again ... to .10, .15 etc and trying to make people do it right. I was hoping to keep it a straight percentage number. Well, this is weird ... clicking the 25 changes it to the IDENTICAL price of clicking 35!!! And the script parameters are right! Maybe it's in rounding and my number formatting! The inconsistency of this is driving me nuts. I know I have it right - checked it over and over and over. Any help please, for me?
  8. Thank you, JT. I'm using globals because the LineItem is written in Invoices before set in LineItems (many reasons for this) - namely because my validation script can't really validate until EVERYTHING has been entered and finalized on a lineitem. Then validation script checks the logic of it, against a set of 49 rules (rules table) before allowing it to write to LineItems. Well, I originally only wanted them to use buttons but they then wanted to type right into discount field also. And my solution began to expand like urban sprawl, I think. Since I basically have to start over with this (because I can simply not find out why it won't work right on 10), maybe my buttons should just set the discount field when clicked, then staff click an Apply Discount button which uses that figure. Are script parameters number or text? Maybe it's because I have a mix of number fields, text fields and script parameters? Well, I try re-writing it and see what happens. Wish me luck!
  9. Well, I'm back I'm afraid. This is all working ... except when I click the 10 button. It's script paramter is 10. Is this the problem you're talking about Vaughan and Ugo? My Apply Discount script works on figuring all the discounts - except 10! All the buttons work in any combination (between using the gDisplayDiscount field or clicking the buttons ... all except 10. And I just don't get it. What I have: Buttons with 10, 15, 20 etc. Apply Discount Script is simple: Set Field [ gUnitPrice; gHoldTempPrice - Round( Div( gHoldTempPrice * If( IsEmpty(gDisplayDiscount); Get(ScriptParameter); Filter( gDisplayDiscount; "0123456789" ) ); 100 ); 2 ) } If I put a 50 in gDisplayDiscount it works - gUnitPrice changes right. Same with clicking the 50 button (it works) and works with all numbers but 10?:?? I made sure the 10 button is identical as the 50 except the number in the script parameter. I am at a total loss why it won't work - but that 10% is the MOST IMPORTANT!!! They are currently mad at me. Staff, I mean. gDisplayDisc is global text, gHoldTempPrice is global number (with auto-enter do not replace) of gUnitPrice. And gUnitPrice is global number. If you wonder why I'm using two global prices? Because otherwise if someone changed what discount was clicked, it would change the gUnitPrice (according to THAT price) instead of the original one. So I use a hold field to hold the 'original price' and compute off of that for discounts. Oh, I hope there is help for me.
  10. I've been playing with ideas to find customer names that are similar. This is because we have many duplicates. Pattern Count doesn't work, ! doesn't work. I need something that finds similar ones that someone can then find to manually compare. I've been playing with using Filter. It seems to me that if two fields are compared and contain the same letters (most of them) that they might be the same. I attached my play file. Am I on the right track here? Can anyone see what my thinking is, and would something like this work? Or maybe I should include their address also, although someone could have moved. Any ideas to help me find similar names would be wonderful. Also, this file won't work because the fields are in the same record but they wouldn't be ... they would be different records. Big bad bummer. Well, I think that if I remove all letters that match, and only a small number of letters don't match they might be similar. What do you think? Ideas on attacking this problem would be very much loved. Thank you. test.zip
  11. Oh that's perfect! I've spent hours on this. Geez, math is surely difficult. Thank you JT for helping me, especially since I know you're pressed at work right now. I appreciate it a lot.
  12. Bekah

    Date Time Today or Tomorrow?

    Thank you both for helping! I won't be able to try this until tomorrow but it makes sense. In fact, if I join on 'less than' to Shipping2, and they naturally are created in ascending date order, then it should always relate to the first next date (because it'll be the first record in the relationship)! In fact if I understand it, a Lookup would also work here except I'd be concerned that, if someone changes the LastCall in Shipping2, it wouldn't change in Shipping1. Maybe I should keep it as unstored calc just to be sure. But I'll play with both your ideas because I want to understand them both. And then maybe I'll come up with a demo!!
  13. Thank you Adam! I didn't realize I had that backwards. Well, now if Price is 23.29, and I click 10%, it converts it to 2.00. And if I put the 10 in the global, it also changes it to 2.00. Actually, it changes it to 2. I wish percentages weren't so difficult for me. Can someone see what I have wrong? I verified 10 is in script parameter. I need the global to change to 23.29 minus 10%. Thank you!
  14. Bekah

    Date Time Today or Tomorrow?

    Oh! Thank you Jerry and JT for helping me!! I won't be able to try this until tonight, but there's one thing I see; and maybe I just don't understand it all ... When it looks to the next day's shipping date, it won't always be ShipDate + 1. I can't see how it will know what the next ship date is, unless it selfjoins to itself on, uh, I get stuck there - maybe a 'greater than' or something. Do you see what I mean? The next shipdate might be three days in the future, and the LastCall may not be the default LastCall if the time has been shifted, so it'll need to look at that next ship date's LastCall also. Maybe your calcs take this into account but it doesn't appear to, so thought I'd ask. Thank you BOTH so much. I never would have used timestamp!
  15. I have Shipping table. It has one day for every ship date (ShipDate, date). It has LastCall (time) so shipper (or manager) can set the deadline to receive orders for any upcoming day (or that current day). Sales wants to know when this deadline is. But Shipper (or manager) can change the time. Currently, it auto-enters (without Replace) "10:00 AM". There is ShipmentsClosed (number) toggle so shipper can shut off taking orders also, even if before the deadline. ShipmentsClosed also triggers events plugin to run scripts. If ship date/time has passed, it should list the next upcoming 'default' ship date/time. So I need to relate to Shipments on two different days (I think). If the shipment is within that same day, I want it to display in hours, as "Shipping deadline in 1 hour, 22 minutes." I realize even unstored it won't change immediately but that's okay. If ship day is passed (in that same day), I want it to display as "Next Ship Deadline Tuesday, 10:00 AM." Or whatever the next record in Shipping says. The ShipmentsClosed should be at 0 (still open) or it ignores the current day/time (assumes deadline passed even if it really hasn't) and jumps to the next ship day/time. Oh brother. Well, this is what they asked for. I told them I would try. I haven't a clue how to do this ... calculations, relationships or scripts. I've been chewing on this all day and have absolutely no idea even where to begin. Can you point me in the right direction? Thank you!
×

Important Information

By using this site, you agree to our Terms of Use.