Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Complex conditional lookup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Complex conditional lookup

    Hi David,

    Now you see what I mean about two tables and two browses. Leads to easier control.

    Scott, you are worried about screen real estate, what about having the extra browse on a tabbed object.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #17
      Re: Complex conditional lookup

      Hi Keith and David -

      I have still yet to decipher Davids example. I can't see the forest for the trees I think.

      I did manage to get something working partially - some what.
      I just started over and tried it from a different route. Something one of you said got me to thinking, "what if I set the pricelevel and type first before looking up the item_no?"

      This works fine if the lookup tables are the same structure. I still can't wrap my head around the area thing and would like to "bring in" the level and the type from the customer table. Maybe as a variable??

      Any way at least some progress. Let me know if you have any ideas.

      Thanks again to you both for all your help!

      Comment


        #18
        Re: Complex conditional lookup

        Originally posted by Scott Axton View Post
        The other problem I'm having is how to put both 'parts' and 'services' on the same invoice. In other words how to choose where I'm looking for the item number to charge out.
        Maybe a set like this:
        Code:
        Invoice [1:1] Customer
                [1:M] Parts
                [1:M] Services  (or maybe this would be [1:1] ?)
        To get your proper service codes I would use a little xbasic - fetch thru the (or maybe a find the nearest) service area and compare against the customer area, and retrieve the price.
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


          #19
          Re: Complex conditional lookup

          To get to the Area calc, have a look at the Set, under Product_Id - in the Event tab (I think it's the event tab - not at my desk). There's Xbasic code in there that opens the ServiceLookup table and finds the correct Area - based on the Customer Area - and returns the correct price.

          Comment


            #20
            Re: Complex conditional lookup

            Originally posted by Davidk View Post
            To get to the Area calc, have a look at the Set, under Product_Id - in the Event tab (I think it's the event tab - not at my desk). There's Xbasic code in there that opens the ServiceLookup table and finds the correct Area - based on the Customer Area - and returns the correct price.
            Ok, sorry David. Didn't look at your download. Sounds like you solved it. Very good then.
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #21
              Re: Complex conditional lookup

              David -

              I still can't get it to work in your example. I see what and were you did this but it just isn't firing for me in the form.

              I think you're on the right track I'll just keep working it.

              The second example I uploaded (lookup2.zip) works great with parts from two different tables. I will try just a lookup to find just the service marry the two if I can get it working.

              Scott

              Comment


                #22
                Re: Complex conditional lookup

                Peter -

                The structure is basically like you have it.


                Invoice [1:1] Customer
                [1:M] Parts OR Services



                I wish I could just use a formula like rate * sq ft = cost but it just isn't that simple.

                The client has a base rate they charge. As the area grows in size the cost per sq ft drops. Unfortunately not uniformly enough to put in to a mathematical formula. Thus the need for lookup.

                The way I am looking at it is in the servicelookup table the area is the 'key' to find the cost. In the invoice items table the quantity would always be 1 for services or one application - although I suppose theoretically you could have more that one application.

                If you have a chance look at the second upload I did (lookup2.zip) That works fine.

                Thanks,
                Scott

                Comment


                  #23
                  Re: Complex conditional lookup

                  Nothing complex about what you want to do, but if you were to add both products and services in the same invoice, in which field do you want service to go?
                  The invoice item table does not have a field to accept that. Sure you could have one field for either a product or a service, but I am not sure which one you want to dedicate for that purpose.

                  Incidentally, there is one mega major capital sin in your set structure. Will get to that later..

                  Comment


                    #24
                    Re: Complex conditional lookup

                    George -

                    If I read this right - m thinking was that both would be added to the lineitems table.
                    I can see what you're saying about having the same fields in both.

                    OK I give - What major sin(s)?
                    The examples I have posted don't necessarily reflect how I would end up in structure Just what I've done trying to get things to work.

                    -Scott

                    Comment


                      #25
                      Re: Complex conditional lookup

                      Scott:
                      My understanding, you want to have one invoice that includes charges for both products used and services rendered. That's the way it should be. It would be rather ridiculous to send the customer 2 invoices, one for products and another for services not to mention double postage.

                      To include both products and services in the same table, the one that has invoice items, I am not sure where (in which field) to add the service. The table has fields for ID's and some other numeric stuff, but there is no field to accept the type of service provided. Would be rather silly to put that under say produc_ID. What I am saying, perhaps you should add one more field, let's call it description, which will have a description of the product or the service. If that's OK, then we could get to how to get the values you the 2 different tables.
                      Last edited by G Gabriel; 04-25-2009, 07:27 PM.

                      Comment


                        #26
                        Re: Complex conditional lookup

                        Originally posted by G Gabriel View Post
                        To include both products and services in the same table, the one that has invoice items, I am not sure where (in which field) to add the service.
                        Or, you could have the two child tables - products & services and use 2 subreports in the detail section of a report based upon the set.
                        Peter
                        AlphaBase Solutions, LLC

                        [email protected]
                        https://www.alphabasesolutions.com


                        Comment


                          #27
                          Re: Complex conditional lookup

                          Originally posted by Peter.Greulich View Post
                          Or, you could have the two child tables - products & services and use 2 subreports in the detail section of a report based upon the set.
                          Yes.. but I think the question is asked in the context of a form with an embedded browse. At least, that's what's in the zip file.

                          Comment


                            #28
                            Re: Complex conditional lookup

                            Originally posted by G Gabriel View Post
                            Scott:
                            My understanding, you want to have one invoice that includes charges for both products used and services rendered. That's the way it should be. It would be rather ridiculous to send the customer 2 invoices, one for products and another for services not to mention double postage.
                            My thoughts exactly! I just want to list each out 1, 2, 3, 4
                            Code:
                            L1 - Service   Lawn Fertilization       $33.50          1           $33.50
                            L2 - Product   Sprinkler Head           $4.95           2           $9.90
                            L3 - Product   Widget                   $89.00          4         $356.00




                            Originally posted by G Gabriel View Post
                            To include both products and services in the same table, the one that has invoice items, I amnot sure where (in which field) to add the service. The table has fields for ID's and some other numeric stuff, but there is no field to accept the type of service provided. Would be rather silly to put tha under say produc_ID. What I am saying, perhaps you sould add one more field, let's call it description, which will have a description of the product or the service. If that's OK, then we could get to how to get the values you the 2 different tables.
                            That is kind of where I was headed in the second version I posted above (lookup2.zip) I created a type in the line item - the choices were Product or Service. I don't have a customer table to lookup from in that example because I stripped out the items and lookup tables just trying to get that part to work. My intention is that cost is cost whether product or service. If a service qty = 1. If a product Qty = 1 to whatever.



                            Comment


                              #29
                              Re: Complex conditional lookup

                              Originally posted by G Gabriel View Post
                              Yes.. but I think the question is asked in the context of a form with an embedded browse. At least, that's what's in the zip file.
                              I guess so. Except the 2nd zip file by Scott doesn't have any forms.
                              Peter
                              AlphaBase Solutions, LLC

                              [email protected]
                              https://www.alphabasesolutions.com


                              Comment


                                #30
                                Re: Complex conditional lookup

                                Originally posted by Scott Axton View Post
                                My thoughts exactly! I just want to list each out 1, 2, 3, 4
                                Code:
                                L1 - Service   Lawn Fertilization       $33.50          1           $33.50
                                L2 - Product   Sprinkler Head           $4.95           2           $9.90
                                L3 - Product   Widget                   $89.00          4         $356.00
                                In that case, I would fill that table w. xbasic, using a button called "New Item" or whatever. The button could pop up a choice, "product" or "service" and an xdialog could pop up for either one. There's a million ways to do this, really.
                                Peter
                                AlphaBase Solutions, LLC

                                [email protected]
                                https://www.alphabasesolutions.com


                                Comment

                                Working...
                                X