Hi there
I would like to highlight all values of A column if they appears in another table with the same description text
So for example : Highlight values from (table A, Column 4) if (table A, Column 4)=(tableB, Column5) and if (table A, Column1)=(tableB, Column1)
I tried this : AND(table A[Column 4]=table B[Column 5],table A[Column 1]=table B[Column 1]) But it did not work.
Can you help me please ? Thank you !
Hi @David1! Welcome to the community!
In AppSheet, an expression like
table A[Column 4]
will produce a โlistโ of all of the values in column 4 of table A. Format rules evaluate expressions from the perspective of the table they are associated with. So, since your format rule is for table A, [Column 4] is what you need, not table A[Column 4]. To determine whether or not Column 4 in table A is the same as Column 5 in the same row of table B, I think you will need to use a LOOKUP() expression. The problem with a LOOKUP() expression in a format rule is that, even though you should be able to get it to work properly, youโll get a warning about it being โexpressiveโ (possibly slowing down your app). I posted a little about that problem, including a LOOKUP() expression I used in a format rule, here:
Since you want to combine two conditions of this type, it is all the more likely to slow your app down if your app gets very big.
Reorganizing the data in your tables into one table might simplify things. Or, if you do need to have separate tables, you might want to use virtual columns to prepare simple YES/NO data (based on the conditions youโve outlined), that your format rules can refer to. Even though virtual columns also take some computing power, itโs my impression that they are not as โexpensiveโ as format rules with more-or-less the same expressions.
If youโre fairly new to AppSheet, I can imagine that this is a lot to take in. Iโve been using AppSheet for a few years and I had lots of warnings about my format rules being โexpressiveโ until just last week. Good luck!
List Operators
LIST(any-value[, another-value]โฆ)
{ any-constant[, another-constant]โฆ }
table-name[column-name]
Thank you @kirk !
I tried also tried with lookup formulas but did not work as wellโฆ it was something like : (LOOKUP(โNameโ, โTravauxโ, โAnimalโ, โtravauxโ))=(LOOKUP(โNameโ, โObjectifsโ, โAnimalโ, โObjectifโ))
I tried with the select function as wellโฆ did not work too !!
But Iโll opt for the virtual column or a new column in my Worksheetโฆ very easier !
Thank you very much for your help !!
LOOKUP() and SELECT() can be tricky. Iโm not sure why they didnโt work but perhaps youโll have better luck with virtual columns.
One advantage of working with virtual columns is that, while you are learning, you can divide your task into several different virtual columns (each with a different role) that are brought together in yet another virtual column. That may not be the most efficient strategy in the long run but it makes testing and debugging a lot easier than working with one complicated expression.
Good luck!
I finally made it wth a new column in my worksheetโฆit works fine !
kirk, i know it is not the good thread for this but i have another problem : Do you know how to chose the columns i want to see in a related table ? (iโm not sure my explanation is goodโฆ sorry for this) ! HEre is a screenshot : Screenshot_20200217_142658_x1Trackmaster.x1Trackmaster|230x500
For example in โrelated Varietesโ I do not want to show โKeyโ Or โParcelleโ columns bot others.; I tried to change the label column but i do not find any logacl explanation of how the app choses which column to show here
Thank you
I donโt have much experience in working with related tables. I hope someone will see this and offer some help. If you donโt get a good response, it might be a good idea to post a separate inquiry. Good luck!
User | Count |
---|---|
18 | |
9 | |
8 | |
5 | |
5 |