| Author |
Message |
rlivermore
Groupie
Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
|

Topic: Suppress matching records Posted: 14 Jul 2014 at 9:57am |
|
CR 10 Pro, SQL 2008 database
How do I configure the formula below to ignore certain matching records (tblsolog.logreason = bereavement or workers comp) but print everything else?
-- Current formula --
WhilePrintingRecords;
NumberVar L1PTOMinutes;
NumberVar PrintHours;
NumberVar PrintMinutes;
PrintHours := Truncate ((L1PTOMinutes) / 60);
PrintMinutes := Remainder ((L1PTOMinutes), 60);
Else If ((PrintHours = 0) and (PrintMinutes = 0)) then "0:00"
else ToText ((PrintHours), 0) + ":"
+ (If ((PrintMinutes) > 9) then ToText ((PrintMinutes), 0)
else "0" + ToText ((PrintMinutes), 0))
|
IP Logged |
|
|
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

Posted: 23 Jul 2014 at 5:47am |
|
why not in the object format, conditionally suppress it with logic like:
{tblsolog.logreason}="bereavement" or
{tblsolog.logreason}="workers comp"
or if this is the only item on the line, you could suppress the whole section in Section Expert.
The hard part is altering any aggregates like AVG or SUM as they probably shouldn't contain values that are not displayed.
For that you would need a running total (not my baliwick...DBlanks) or used shared variables to keep track of the values that you want/need for your aggregates. In which case you would alter your above logic to not add the the hours and minutes to some total.
HTH
|
IP Logged |
|
rlivermore
Groupie
Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
|

Posted: 24 Jul 2014 at 6:02am |
|
There are other formulas in this detail section, so I want to suppress in this formula but then display only those records in a separate formula.
Basically, I'm attempting to display the following
1. Regular hours < 40
2. OT hours > 40
3. Other hours = the 2 I'm attempting exclude in OT hours
4. Total hours
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

Posted: 25 Jul 2014 at 4:58am |
|
ok. you can suppress the output by either hiding the formula conditional or setting it to 0, you don't need to hide the section.
Altering the Aggregates is another story and will take more work.
|
IP Logged |
|
rlivermore
Groupie
Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
|

Posted: 28 Jul 2014 at 12:05pm |
|
I really appreciate your help but the report had other formulas that I previously missed which made this adjustment fairly easy.
|
IP Logged |
|
|
|