0

create reference for existing data

I have imported data into two tables. invoices in one and company in the other. The invoices already have the company name ina field in that table so how do I create a reference between the two using company?  There is over 40,000 invoices so its not practical to do this manually.

4 replies

null
    • Mconneen
    • 6 yrs ago
    • Reported - view

    There is some good information here..

    https://ninoxdb.de/en/manual/import-and-export/importing-linked-data

    but you may have to re-import them. 

    You can also create a reference between Invoice and Customer (A customer may have 0:N Invoices.. an Invoice will have 1 and only 1 Customer).... then either use the console.. or create a button that updates each Invoice with the customer by doing a look it.  This is a rather simple for loop... 

    See https://ninoxdb.de/en/manual/calculations/reference-of-functions-and-language  .. and search for "loops"

    DISCLAIMER.. NOT TESTED.. :) 

    for i in (select Invoice)
      i.Customer = first(select Customer)[Name = i.CustomerName]

    If this does not get you close.. I can actually hack something out. 

    • Mconneen
    • 6 yrs ago
    • Reported - view

    Sorry.. that should be "... by doing a LOOK UP".. :( 

    • barrybowles52
    • 6 yrs ago
    • Reported - view

    Mconneen, Thank you so much for a very quick response !  I used the importing linked data instructions and I have resolved the issue.

    Again - your prompt answer is much appreciated.

    • Mconneen
    • 6 yrs ago
    • Reported - view

    You bet Barry.. and Happy NinoxING.. ;) 

Content aside

  • 6 yrs agoLast active
  • 4Replies
  • 2062Views