0

Select using []

I have two related tables Projects and Work Reports.  In the scrren shot below you can see Projects (formula) in the Projects form and below the View of the related Work Reports.  The view is simply select 'Work Reports'.

I just cannot get my head arounbd how I select 'Work Reports' so that only records in the view match the Projects field/formula above it.  Would love sopme help here please.  I want to only show 8651 records in the view in this instance.

7 replies

null
    • Mel_Charles
    • 1 yr ago
    • Reported - view

    Here is one of my table views if that will help

    Before filter (Search Item Clear)

    and after the Filter is set to search Item set to find Business Cards

    my script in the table view

    you should be able to bend to suit yours

    let myID := Custid;
    let myItem := 'Search Item';
    do as server
        select JobDockets where Cust_ID_fx = myID and Desc like myItem 
    end

    • Fred
    • 1 yr ago
    • Reported - view

    Just to verify, your screenshot is of fields in the Projects table?

     

    Alan Cooke said:
    In the scrren shot below you can see Projects (formula) in the Projects form and below the View of the related Work Reports.

    I see a field called PROJECT. Is that the formula field you are talking about? If it is can you post that formula? If it not then what kind of field is PROJECT?

     

    Alan Cooke said:
    I have two related tables Projects and Work Reports.

     If you have two related tables then on the 1 side of the relationship (which I guess is Projects), then you can (if the name of the reference to Work Reports is Work Reports) simply put the following in the view element formula:

    'Work Reports'

    This will pull only records in Work Reports that are related to current record in Projects.

    But you already have the reference view table in Projects so there is no need to create another view with the same data.

    I'm not sure what your subject line has to do with your question. The square brackets [ ] is just another way of filtering selections. I find them easier to use as they are used to filter reference links as well.

    You could write:

    let t := this;
    select 'Work Reports' where Date = t.Date
    or
    select 'Work Reports'[Date = t.Date]
    

    In reference field filtering, you can not write:

    let t := this;
    'Work Reports' where Date = t.Date
    

    It has to be:

    let t := this;
    'Work Reports' [Date = t.Date]
    
      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Fred Thanks for all this info - Been a long time since I buried myself in the data model I created.  Projects has a sub table Tasks which has a child Work Reports.  Reason being that Work Reports are technically based on a task which in turn is based on an overall project.  This is why 'Work Reports' as a view does not work and has to be Select 'Work Reports.

      That is to say for example:

      Project = fix bathroom
      Task = fix basin (other tasks like fix shower etc)
      Work report = What I did to the basin to make it work.

      SORTED!!

    • Fred
    • 1 yr ago
    • Reported - view
    Alan Cooke said:
    Projects has a sub table Tasks which has a child Work Reports.  Reason being that Work Reports are technically based on a task which in turn is based on an overall project.  This is why 'Work Reports' as a view does not work and has to be Select 'Work Reports.

    Well that is an important bit of info. 😉

    You can also just follow the reference links if you don't want to do a select. You can put the following in the view element formula:

    Tasks.'Work Reports'
    

    Then add a column to Tasks.Name (or whatever the appropriate field is), so you can order by Task.

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Alan Cooke Fred "Well that is an important bit of info." :-)

      And that is what I did.  I had simply forgotten that Work Reports was a child of Tasks and that was primaily because in the Sidebar Works Reports sits inside the Projects drop down list.

    • Fred
    • 1 yr ago
    • Reported - view
    Alan Cooke said:
    And that is what I did.  I had simply forgotten that Work Reports was a child of Tasks

     Sorry, Alan, if I came across as scolding. I forget my structure all the time.

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Fred Not at all - never entered my mind - only scolding was from me to me :-)

       

      I really wish Ninox would work on the data model page a bit.  Make it like Access please - move around and choose what to display

Content aside

  • 1 yr agoLast active
  • 7Replies
  • 86Views
  • 3 Following