I have a form, that contains a reference table related to a part number.
This table contains quantityโs of sub-parts.
I want the sum column of this table to calculate the extended quantity from the number shown in the form.
So, from my terrible diagram, here the sum column should show 15 and 15.
It it possible to do this kind of reference within a reference?
@tony Iโm going to explain these records a bit, and where I have gotten so far.
Table A - Logs that Have a component Part number, This part number is a reference to Table B.
Table B - This has a list of level 2 part numbers included in every component.
Table A Form, has an inline table that shows the level 2 parts and quantities using the following expression in a virtual column in Table A
=SELECT(Includes[_ComputedKey],[_THISROW].[Whole Component Code] = [Component Code])
I want a qty amount chosen on this form, to reflect in the sum column of this inline table.
Besides getting it to do the math, I canโt seem to get it to pull in the quantity from the form at all.
Ideas?
Should I stop trying?
@Rosemary_Black You can use a de-reference like this: [Reference Column].[Column from referenced table]
Hereโs an example of dereferences in action: https://www.appsheet.com/samples/A-basic-demo-of-table-references?appGuidString=6ffad040-b04a-4325-a...
@tony I am having a really hard time getting this to work.
I tried it first with the original setup of a double de-reference, and changed the structure to only use a normal de-reference.
I just canโt get it to work correctly.
I feel like I have tried everything.
@Rosemary_Black Unfortunately, I donโt think itโs possible to do in AppSheet currently. Google Sheets and Excel allow you to express more with their formulas.
Itโs possible that someone in the community (@Aleksi_Alkio?) could come up with a workaround, but I canโt think of one.
@Rosemary_Black Right now double dereference (e.g. something like [Ref column].[Another ref column].[Some other column]) cannot be used. Youโd need to create a virtual column to store [Ref column].[Another ref column] and then use [Virtual column].[Some other column] to access the second level.
@tony Can the virtual columns be List type instead of Ref type?
I think my issue is not only the double dereference, but that 2 of the columns arenโt key columns.
Thank you for your help!
@Rosemary_Black Columns can be list type, butโฆ I suspect that is not going to be helpful for you.
If table A has a reference to table B, then you can use a formula like [Ref to B].[Quantity] to access Bโs quantity value. Iโd start from that.
@Rosemary_Black Iโm still confused. Each log (TableA) has a reference to a part number (TableB). Is there a difference between โcomponent part numberโ and โlevel 2 part numberโ?
@tony Yes, So each component is made up of a bunch of other parts.
So, The form (table A) references one component code, which pulls up the table of the parts within that code.
So, if the form calls for 2 of the component code, then all the quantities of the individual parts in the table needs to be x2.
@Rosemary_Black Okay, so it sounds like your relationships are:
Logs ==ref==> Components SubParts ==ref==> Components
The first relationship is saying that each Log has a Component. This means that each Component has many Logs.
The second relationship is the same: each SubPart has a Component, and each Component has many SubParts.
If I understand correctly, youโre saying that you want each SubPartโs quantity to be updated based on some input in the Logs table.
This canโt work, though. To see why, imagine that you have log1 and log2. Both of those logs reference component15, which has subpart8 and subpart3.
What should the quantity of subpart8 and subpart3 be? They are related to multiple logs (log1 and log2), so they have no notion of a single quantity.
So, with your data, thereโs not really a good way to do this.
@tony The thing is, I am only trying to see this data virtually, not actually log it anywhere.
Just in the form, so the total parts quantity can be seen.
If I were making this table in a spreadsheet for example, I would so something like
=โreferenced Part Qtyโ*(index(โlogsโ,match(โThis Logs Keyโ,โLog Key Columnโ,โReturn Component Qtyโ),1))
I have to imagine there is a way to make this work in the app, if I could make it work in a spreadsheet right?
User | Count |
---|---|
16 | |
10 | |
8 | |
5 | |
5 |