Jump to content

Don't show empties


mnelson

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

Recommended Posts

How do I make a portal show only records with something in them, not empty rows? I've gotten as far as making a calculation field that shows a 1 if the record has something in it, but cannot make that 1 translate into showing only those records in the portal.

Link to comment
Share on other sites

You have really done the hard part, created the field for the "right" side of the relationship (from define relationships). For the "left" side of the relationship, you have a couple of choices. 1) You can create a global number field and set it to "1". This is useful if you wish to turn the selection on and off or set the matching relationship to other numbers. Say you wanted to see record with different combinations of empty fields. You calculation could calculate to 1,2,3,4... depending upon which fields were empty. To take advantage of this, you would set the "left" side global field to the appropriate number. 2) You can create a calculation field:

Constant (calculation, number, indexed) = 1

and use this for the "left" side of the relationship. It can't be changed, but you never have to worry about it being set properly.

-bd

Link to comment
Share on other sites

Your relationship matches the primary key in the master file to a foreign key in the related file. Create a calculated foreign key that returns the key value only when the data fields are not empty:

foreignKeyNotEmpty(calc,text) = If(IsEmpty(dataField),"",foreignKey)

Make a relationship from the primary key to the new foreign key and use it for your portal.

Link to comment
Share on other sites

  • 1 year later...

My datafield is based on relation calculation with other database so I could not make foreignkey to work with relationship of master because it will not be indexed.

Is there a case to not show empties since I use calculation based on relationship

Thanks

Link to comment
Share on other sites

Hi,

Sorry I thought you get it. The method will be exactly the same, you just need to turn your calc in the main to be c_checkempty = Case(Is Empty (your related calc), 0, 1).

....Then follow the solution given for the dates case.

1. Scipt a perform find for all 1 in the calc above in the related file.

2. relookup using Mod keys to index your calc in a num field in the related file

3. show the records from a 1 to 1 relationship from a global in theMain and your indexed number in the related file.

Link to comment
Share on other sites

HEllo LiveOak,

I really don't get your logic so that portal can not show empty...since the relationship is not based on calculation field = 1 .

Let's say I used relationship on Database A with field Project and Database B with field Project.

From Database A , I make a relationship based on Project. So When I puldown the portal in A ... I don't want to see the empties from B ...

I don't see any relation connected with calculation = 1. Could you explain me how calculation = 1 don't show empties?

I am really curious about it

Thanks

Anh Tran

Link to comment
Share on other sites

Tranh Anh,

There is a logic here in a 1 to 1 relationship or in a "Project" to "Project" relationship.

In your related file, change the calc to be c_checkempties = Case(Is not Empty (Project), your key field, " ").

Use this new calc for the right side of the relationship, and empties won't show.

If this calc would use some relationship and couln't be indexed, use the solution provided before to index this calc and use the new indexed field for the relationship.

There is always a logic as long as you understand how relationships work.

Cheers.

Link to comment
Share on other sites

This topic is 7681 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.