Jump to content

Calculation based on filtered portal count


crazybake

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

Recommended Posts

I used one of the forum threads to get the count of a filtered portal.

- create a summary field that has the count of PKID

- duplicate the portal - set to a single row portal and put summary field in - this works great.

and I know that an empty row shows up in portals because of the relationship.

I cannot figure out how to create a calculation field based on the portal count.

example: I have (2) filtered portals in a layout that filter items based on a due date. If it is late it appears in portal 2, on time it appears in portal 1.

I duplicated portal 2 (and turned it into a single row and included the count field). It shows the count correctly based on the number of rows in the portal 2. However, when the portal is empty (except for the empty portal row) the count field 'appears' empty (does not display a zero).

I am trying to create a calculation field that will show a text result based on the count field:

if the count field is less than 1 will show 'on time' and if greater than 0 shows 'late'.

how do I do this?

Link to comment
Share on other sites

That seems to work great - can you help me get one step further?

I need two calculations (one script, one field)

1.) If [not IsEmpty ( GetAsNumber ( GetLayoutObjectAttribute("PortalLateCount";"content" )))]

Following the info you gave me above - I use this script step, if "true" to show a dialog box and if "false" to continue. It seems to work, but still not sure if the syntax is correct.

2.) My issue is in the evaluation. I want to create a field that displays "late" if the above is true and "on time" if false. I tried the same syntax:

If (IsEmpty ( GetAsNumber ( GetLayoutObjectAttribute("PortalLateCount";"count") ) );"On Time";"Late Items" )

The evaluation either does not think the summary field is empty (which it does not display zero when there are no portal records. Is this because of the empty row based on the relationship?) In fact, it looks like it is working backwards - huh?

Can you help with better (or correct) syntax - I seems to be mixed up somewhere

Link to comment
Share on other sites

Hmmm - thought it worked - I guess not..

Just to test - I created another calculation field on the same layout GetPortalCount.

GetLayoutObjectAttribute("PortalCountField";"count")

The summary field called PortalCountField shows a value of "2" the GetPortalCount is blank.

This is the issue I have been having.

I am a moron!- Thanks for the help. Instead of using "content" for LayoutObjectAttribute, I was typing "count"

Edited by crazybake
Link to comment
Share on other sites

  • 9 months later...
  • Newbies

Hi there -- 

Can you help explain how you are doing the FilterLabel example?

 

I cannot figure it out! -- and it appears so elegantly simple!

 

I can't see how the sCount summary calculation is able to count "good" and "bad" from the category field. -- since it is doing a summary from the ChildID, how does it get the value contents of "Category"?

 

Just to see if I could modify this to grasp how it works, I tried adding another sCount value -- i.e., "Fail". I couldn't get that to function.

 

Can you explain this a bit more? I can't seem to discern what is happening. : (

Link to comment
Share on other sites

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