0

Tabellenspalten in Ansicht mit Bezug auf Feld des Datensatzes, wo die Ansicht angezeigt wird, konfigurieren

Hallo,

gibt es eine Möglichkeit eine Tabellenspalte in einer Ansicht (von einer anderen Tabelle) mit Bezug auf ein Feld des Datensatzes wo die Ansicht angezeigt wird zu konfigurieren?

Denn grundsätzlich kann man bei der Konfiguration der Tabellenspalten einer Ansicht nur im Kontext der ausgewählten Tabelle arbeiten.

10 replies

null
    • Fred
    • 2 mths ago
    • Reported - view

    You can reference a field in another table in the View form and view element. If you click on a column then click on Show column, you have a choice of the fields in the table, but at top you have a choice to enter a formula.

    Can you be a bit more specific about what you want to do? The table names? The field names? How the records are related?

      • Robert_Deimel
      • 2 mths ago
      • Reported - view

       

      Thanks for help, but that's not what I'm searching for. 

      I have a table "storage location" with a subtable for inputs and outputs to the storage. Then there is a table with work there I have a subtable with buildings and a subtable from buildings with articles and quantities used from the storage location which is linked to the I/O-table from storage location.

      Now I want to create a view in storage location to show a list of the work where the storage location was used (that is working) but I also want to have in this view a column with the sum of the quantity which is used from this storage location. → And that is the problem how can I told the view which is working in the background of the working table that I want the sum of the quantities from my storage location detail view I'm in.

      • szormpas
      • 2 mths ago
      • Reported - view

        Hi, can you take a screenshot of your database data model? It would help a lot!

      • Robert_Deimel
      • 2 mths ago
      • Reported - view

       

      I have build a small test-database with the structure

      • szormpas
      • 2 mths ago
      • Reported - view

        Hi, to achieve this, try the following approach:

      1. Create a View (Ansicht) and put inside its formula 'work material'
      2. Create a formula column (work date), put in the script 'work on buildings'.Work.Termin and choose the 'Grouped' option
      3. Create a column of the 'quantity' field and choose the 'sum' option in the footer

      There are probably better solutions, but use your Ninox relationships to your advantage!

      • Robert_Deimel
      • 2 mths ago
      • Reported - view

       

      Thanks, but that is what I already have and not what I want.

      I want the view with the table "work" not "work material"  because I want to have a shorter list and get directly into the work detail-view. That's for better overview and less clicks during daily work.

      • szormpas
      • 1 mth ago
      • Reported - view

        Hi there, I just wanted to suggest that you use the 'work material' subtable to calculate the sum quantity per work of the specific storage location as above. You can also add a 'View' of the 'Work' table for easy access if you think that would help.

    • Fred
    • 1 mth ago
    • Reported - view
     said:
    I want the view with the table "work"

    I would recommend that you just follow the relationship back to the Work table. Something like:

    unique('work material'.'work on buildings'.Work)

    Why use the unique() command? Try it without and you will see multiple instances of Work records. And the UI reacts funny if you try to select the first instance of the duplicate record.

      • Robert_Deimel
      • 1 mth ago
      • Reported - view

      Sorry, can you explain this in more detail or build it in my example, because I don't know where to use this command to get sum of the quantity in my view for the work

      • Fred
      • 1 mth ago
      • Reported - view

      I uploaded the wrong DB. Sorry.

      So your Ansicht view element is using:

      select Work

      Which will find all Work records regardless of association with the record in storage location.

      You may want to change it to:

      let t := this;
      select Work where contains('work on buildings'.'work material'.articles, t.articles)

      Then at least it will show only Work records that have the article record Id that matches the article Id in the storage location record.

      or you can do what I recommended earlier:

      unique('work material'.'work on buildings'.Work)
      

      And it will do the same thing without having to do a select call. Which we always try to avoid whenever possible.

      The limitation with view elements is that loses the ability to reference the current record.

      If you change the sum of quantity column formula to:

      sum('work on buildings'.'work material'.quantity)

      You will see a number that doesn't match the sum under work material. Because it is adding up all of the quantities of all the articles related to the Work record.

      There is no way to reference the current record to get the article record in the view element. Something we have been asking for.

Content aside

  • 1 mth agoLast active
  • 10Replies
  • 62Views
  • 3 Following