Forums
Extending Daylite
Scripting
F-Script Qualifiers on tables at two levels in one report|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
I am working on a report of selected Contacts who play one particular role in their Organizations.
Contact data is set on my primary table and my script for selecting the contacts associated with the particular role is working fine. I set Role as the data on the nested table using a Key Path Filter as illustrated in materials from MarketCircle. This works fine as well. However, as expected, the Key Path Filter returns a table row for each role associated with each Contact that meets the Contact selection criterion. Specifically, my qualifer for Contacts selects a record if it has the role of "Ad Buyer." (I sell advertising.) If that Contact also has the role of "Executive" the Key Path Filter will provide a row for Ad Buyer and for Executive. Now I want to filter out all Roles except Ad Buyer. I assume that I need to set a selection filter on the Roles table but I'm already using the Key Path Filter to fetch the data. What should I do now? Can I add a script filter to the Key Path filter or vice versa? Can I specify the Key Path in a script filter? Thanks! Bob |
||
|
|
Marketcircle Team |
You can use a script filter in the nested table. I think I'm following you, but it's a little hazy.
I'm assuming that the parent is a table with contacts. Each row has a contact and each contact has roles. --------------
"Get the contact from the parent row"
contact := element valueForKeyPath:'parent.reportData.object'.
roles := contact roles.
c := roles count.
i := 0.
"Create another array to put the matching roles in"
filteredRoles := NSMutableArray arrayWithCapacity:c.
[i < c] whileTrue:
[
role := roles objectAtIndex:i.
role_name := role valueForKeyPath:'roleType.name'.
(role_name isEqualToString:'Ad Buyer') ifTrue:
[
filteredRoles addObject:role.
].
"Increment the counter"
i := i + 1.
].
"Return the filtered roles"
filteredRoles.
|
|||
|
|
Apprentice |
Thanks, AJ! I put the script into the data specification for the nested table and the results in the sample report were "no data." I have included links to the report specification and script windows below. What have I done wrong? Thanks again!
My test files |
|||
|
|
Marketcircle Team |
Yikes - I didn't realized you responded.
I tried downloading the files - but I have no way to uncompress hqx's - can you just zip, dmg or tar them please. Thanks. |
|||
|
|
Apprentice |
Hi, AJ. Those files are jpegs. They are just screen caps. If you like, I can email them to you directly. Thanks, again.
Bob |
|||
|
|
Marketcircle Team |
sure - or send the report and script file directly - that be more productive than looking at a screencap.
|
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Forums
Extending Daylite
Scripting
F-Script Qualifiers on tables at two levels in one report
