Math Filtering

Hello all,

I’m building a live dosing calculator in my app that requires different calculations for different medications in a particular order, but I’m having difficulty getting it to show up the way I need it to. Here’s what’s happening:

The D10 and NS volumes are calculating appropriately; however, I need Dextrose to show in the app only when the SV column is 4201 and NS to show in the app only when the SV column is 4202, etc. I have close to twenty (20) different calculations that I still need to create, with different results appearing with each associated medication.


I’ve been using the hint components because my user base is familiar with the “Green = good / Yellow = caution / Red = ASK FIRST” rule, and it works appropriately with the medication names popping up, but right now, I can’t quite wrap my head around how to make the text line dynamic. In the picture above, the medication name (Normal Saline) is correct for the policy selected, but the dosing (2.1 gm / 21 mL) is associated with Dextrose from the policy above. Obviously, I can go into the Editor and change the text line so that it pulls from the NS Vol, but then it would change the text line for the other policies too (away from the template that I currently have).

I’ve tried everything I can think of so now I’m turning to the smarter people in the room. Please help! Thank you in advance!!


Can I assume that your screen is filtered where Policy Number is SV Policy Number?

If that’s the case, then isn’t a simple matter of pointing your Hint component at the Med 1 Dose column?

Hey Darren,

Thanks for the quick response. It would be that simple if I was using that column - I just haven’t deleted it yet. Those doses are all static and don’t apply to this particular sheet. I need to use the MATH columns.

Which math columns?

Why can’t you just use a template column to join the bits together?

Sorry, but I don’t get what the challenge is. If your screen is filtered to the correct row (is it?) then you should be able to do whatever you want with the data in that row.

The math columns are in three of the last four in the screen cap of the Data Editor that I posted in my original post. And you are correct about the row being filtered correctly - which it is. The problem is that the the math columns are calculating in EVERY ROW, no matter which one that I select. I don’t need all of the calculations in the app, only the ones applicable to that specific row. When I change the template in the text element of the hint component so that it’s showing the data that I need, it shows that template in all instances of that component, regardless of the row chosen

That’s what a math column does.

That’s to be expected, but I’d also expect to see data that’s appropriate to the selected row, so I’m still not understanding what the problem is.

Clearly I’m missing a key point somewhere - any chance you can make a short loom video and talk it through?

It seems that I didn’t clearly explain the issue that I’m seeking to resolve, so I apologize for the confusion. I am not under the impression that the Data Editor is doing something that it’s not supposed to; it is exhibiting expected behaviors and I am aware of this. I am also aware of what happens when a data point is assigned to a specific part of component in the app, and that it will continue to show what was chosen unless / until that data point is changed manually, making it a “static” value.

The issue that I’m trying to resolve is that I need the text element in the hint component to display dynamic dosing information based on the medication listed in the policy that is selected. Because the math columns are calculating across the entire row, I can only select one of the templates that I’ve created and I need the template to be based on the medication in each “Medication X (1, 2, 3, etc.)” Column.

EX: in the screen capture above, the policy chosen is 4202, which appears correctly in the app (below). In the first hint component, it shows Normal Saline, which is the appropriate medication as detailed in the Medication 1 column.


The text line, however, continues to show the template that I created for the preceding policy (D10 Template). I need it to show the calculation in the math column next to that so that it reads “82 mL” (from the NS Vol math column).

Sorry, still trying to wrap my head around this.

Can you explain the formulas in each of your math columns?

It looks like your template is joining the values in the D10 Dose and D10 Vol columns - what makes those values inappropriate for the current row?

What logic would you use to decide whether to display the D10 Template or the NS Vol column?

Note: Please don’t take offence at all the questions, I’m just trying to get a clear picture in my mind what the actual challenge is. Once I have that, I expect the solution will most likely be self evident. I just need to keep prodding and poking until the penny drops


That’s really helpful.

It looks to me what you need to do is adjust the action on your Inline List.
At the moment I’m guessing that it’s just doing a Show Detail Screen → This Item?

What I think you need to do is make that a custom action, with the first step being a Set Column Values that clears the value in that User Specific Column, followed by a Show Detail Screen → This item.

You could then add a visibility condition to your Hint component such that it’s only visible when the User Specific Column is not empty.

I’m pretty sure that should solve the problem, although the one thing I still find a bit confusing is where you say the template “holds” the previous value. Assuming that you’re attached to the correct row - and it looks like you are - I don’t see how that can possibly happen. Unless there’s something going on that I can’t see.


Hey Darren,

Apologies for my delayed response. Thank you for the suggestions.

My inline list already has a custom action:

The policy that’s selected from the inline list is entered as a SV on a different table, which is then used to “set” the same policy across three separate, but related, tabs:

(*Disregard the last tab, that’s the one I’m currently working on.) From any of the tabs (seen above) the floating button uses another custom action to clear the policy value from the main SV column and return the user back to the inline list where they can pick another policy.

What I have setup so far in another GT (seen above) is essentially one big calculator that uses different formulas to calculate appropriate dosing and volumes based on industry accepted standard equations (usually mg / kg). The weight that was previously entered, as shown in the video, is pulled in here using a relation then the math columns do the rest. The templates are in place because the end users need to see both the dose as well as the volume that they need to administer.


(Above) What I need to figure out is how to setup a filter that will dynamically pull a template based on the medication that it’s associated with. Ideally, I’d like to be able to have the GT do all of the work so that there are generic “Medication 1,” “Medication 2,” etc. columns that can be plopped into one hint component. My only other thought is that I’d have to create 50+ individual hints, each with different associated templates, then make them conditionally available.

These sorts of details are important to mention, otherwise folks trying to help will be making incorrect assumptions and end up giving bad advice.

I assume that Policy Number is a User Specific Column, yes?
And then you use Single Value columns to apply the entered value to other tables?
How is SV Policy Choice configured - is that taking the First Row-Whole Row from the target table, or?

I need time to digest all this a bit more. These sorts of things are really hard when you don’t have it in front of you. A bit like trying to solve a rubiks cube blindfolded…

But anyway…

If that ends up being your only option, I’ll eat my shoe :wink:

1 Like

I know, I know :man_facepalming: I’ve been working on this app for the last 2+ years and being so close to it makes it hard for me to remember that the backend may be more / less complicated than someone else’s. Articulation is key!

Yes and yes and whole row.

I THINK I GOT IT!!! :exploding_head:

  • I have a single value column pulling in all first line medications from a different table

  • The math columns do the heavy lifting then I use a template to join the dosing and volume together

  • I used an ITE column and built it so that "If Medication 1 is (the name of the med being pulled into the SV column), then THIS TEMPLATE, pointing it to the template that I want associated with that medication.

  • In the other table, where I have all of the protocols already built out, I added a lookup column to look up the ITE column that’s pulling the live calculations.

  • In the text line of the hint component, I directed it to the lookup. BOOM.

It seems to work so far but my head is gonna explode from looking at this thing for the last few days so I’m gonna take the weekend off from it and come back to it on Monday with fresh eyes. I’ll keep you posted @Darren_Murphy!!

1 Like

So I can put my shoe back on then? :grin:


Not yet… if it works then yes. If not, then it’s your fault :stuck_out_tongue_closed_eyes:


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.