Jump to content

List Calculation depending on another field


This topic is 3432 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello,

 

I am having trouble putting a calculation together. I have 2 tables: 1. Main 2. chemotherapy. They are related by key fields:

 

main:pk_main--->chemotherapy::fk_main

 

Chemotherapy has a field called "chemotype" I am able to list all chemo types in a calculation on the main table as:

 

Main: chemolist = list (chemotherapy::chemotype).

 

This works fine and gives me a list of all of the related records to the main but I want to list only a few of the chemo types, specifically the ones that correpesond with another field in the chemotherapy table called "status"

 

I want to list the chemo types with the status as "stopped" only. Not all of the chemo. I do not know how to do this. I tried the filter function, etc but no luck.

 

thanks for the help

Link to comment
Share on other sites

Hi rk,

 

I went through Chemotherapy in 2011.

 

I made a small database so that I could track my vitals such as weight, temperature, blood numbers, etc.

 

Your database sounds like something I  would like to help you with, so why not post a copy of what you have so I can see what your needs are?

 

Lee

Link to comment
Share on other sites

A no-frills way to do this is to add a calculated field in the chemotherapy table, let's call it chemotypeStopped:

 

Case( status = "stopped" ; chemotype )

 

Now in your Main table your calc would be:

 

List (chemotherapy::chemotypeStopped)

Link to comment
Share on other sites

I would like a list. I know how to filter through a portal but I want one with commas

 

To filter at the data level (where the calculation engine can access the filtered results), you must filter the relationship itself. More precisely, you need to construct an additional relationship, for example:

 

Patients::PatientID = Treatments 2::PatientID

AND

Patients::gStatus = Treatments 2::Status

 

where Treatments 2 is another occurrence of the Treatments table. The global gStatus field can be formatted as a checkbox, so that you can select multiple values to include in the list.

 

 

Another option is to use a custom recursive function to list the treatment types of selected status(es) - but you would need the Advanced version to implement this.

 

 

I just want the stopped chemo to put on a small summary form we print out for the patient. 

 

 If the status value you need to filter by is a constant, then the suggestion made by Fitch should work well for you.

Link to comment
Share on other sites

This topic is 3432 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.