Can anyone clue me in on what I’m doing wrong with this expression? My goal was to get a percentage of an item marked “dry” (the “Action”) out of the total number of inspections for that item.
Another way to say it: I’m trying divide a count of a filtered ref (“history2”) into a total count of ref rows.
I gave those fixes a try, but unfortunately it’s performing the same way. Not sure if there is more info I can provide. I assumed the problem was somewhere in my attempt to count a filtered reference and divide into another filtered reference…
Thank you. That seems to have gotten me closer? At least I’m getting different numbers now, but the math is still not working out…This one in the screenshot should be another “75%”, but is showing as 66%…
Thanks, @Suvrutt_Gurjar . I tried that, too, but it’s performing the same way. Still not working. I am using a “percent” column type, but I also tried this as a “number” column.
Is it possible that my filter is counting ALL the rows in the “history2” table that have been labeled “dry?” The problem seems to be with how it is looking up the reference, unless I am wrong…
Thank you for the update. In that case , you may want to once more verify your expression whether it is resulting in correct number of numerator and denominator values. You could check each separately in a VC. I think 66% means possibly 2/3 instead of expected 75 % which 3/4 ( your first result) . Second result you are expecting 100% (3/3) but the result shows possibly 2/3 ( 66%)
So maybe numerator or denominator somehow are not getting all the record values that they should get as per your expectation.
I removed the division part and just tried to get a count of all the “dry” for a given row. Its still giving me (what I assume) is the total count of ALL “dry” for the whole table…
Yes of course it is giving a count for the entire table, you haven’t told it to do otherwise. Is it a parent-child ref situation? If so, instead of FILTER(table…) you can do SELECT( [Related table][key-column]…)
I thought the “this row” component would isolate the results…Yes, it is a parent-child ref. I haven’t had a lot of success navigating the SELECT function, but I’m definitely open to trying again…I hope I at least explained what I was after well enough.
You are wildly mistaken about the role of _thisrow. It’s function is to resolve any ambiguity of context. Imagine you’re in the record of table1 with a column [category], and you’re selecting across table2 by matching to its own [category] column. Using FILTER( table2 , [category]=[category] ) is going to return all records in the table, because every record’s [category] column equals it’s own [category] column. But you’re wanting to match it to the current table1 record’s [category], so you use _thisrow to specify which context to pull that column from, with FILTER( table2 , [category]=[_THISROW].[category] ).
No, your new SELECT expression is still selecting across the entire table, it is doing the same thing as before.
I mentioned that you can select across your [Related…] column, which you didn’t seem to catch. You’d need to do one of the following, which are equivalent, but the former is more efficient.