Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress on Condition?

Status
Not open for further replies.

supportsvc

Technical User
Jan 24, 2018
249
US
Hello,
There's a report that shows monthly for the current quarter.

So it's currently Quarter 1 with Jan, Feb, Mar showing (next quarter it'll show Apr, May, Jun, etc ...)

Anyway, I have the following code in the conditional format on Suppress so that it'll ONLY show the data in the current month
Code:
ToNumber({PR_DeductionReportWrk.CalendarMonth}) <> Month(CurrentDate)
However it is still showing data for each month columns.

 
Have you checked {PR_DeductionReportWrk.CalendarMonth} to confirm it does contain a number(1 to 12) that corresponds with the months January to December?

Assuming that checks out, there is nothing obvious to indicate it wouldn't work as you expect.

Cheers
Pete
 
I believe so, the headers are ALL suppressed with the code
 
Where are you using this suppress formula?

Can you give an idea of report layout and what you are trying to suppress?
Ian
 
So it's a Quarterly report

1st Quarter right now but in the 2nd month

Report format:

JANUARY FEBRUARY MARCH QTR YTD


Need to suppress Jan and Mar since it's Feb
Next month Jan and Feb should be suppressed
 
Does that mean for February report will look like this

FEBRUARY QTR YTD

And in March
MARCH QTR YTD

In which case you do not want Suppression you need to create two formula for col 1
This will then return data for Column Title and Data

Ian
 
Those columns already exist and will display according.
I just need to suppress the months that's not in the current quarter.

So only display the Feb. data set.
 
Create a formula
@MonthNo
ToNumber({PR_DeductionReportWrk.CalendarMonth})

Place this next to your data and see what is returned.

How is data grouped and where is data displayed, detail or group footers

Ian
 
Here are the images of the design and the results.

Deductions_Design_vzs2gl.gif


Deductions_guaai0.gif


Trying to suppress the months that are not in the current month.
 
It looks like this is a manual crosstab using running totals. You need to use field suppression, not section suppression, but for help, you need to show the contents of the conditional formula used in the running total evaluation section. So just open each of the three running totals in one of the footer sections and then go into the evaluation section->use a formula-> and copy and paste the formulas into this post so that Ian or I can see how they are handling the date condition to create the three distinct columns.

-LB
 
1st column
Code:
formula = ToNumber({PR_DeductionReportWrk.CalendarMonth}) = ({@QuarterToPrint} - 1) * 3 + 1

2nd column
Code:
formula = ToNumber({PR_DeductionReportWrk.CalendarMonth}) = ({@QuarterToPrint} - 1) * 3 + 2

3rd column
Code:
formula = ToNumber({PR_DeductionReportWrk.CalendarMonth}) = ({@QuarterToPrint} - 1) * 3 + 3
 
What is the content of {@QuartertoPrint} and of any nested formulas within that formula?

Also, I was assuming that the same amount field is being evaluated in each RT. If not, I guess the amount fields might be specific to each month?

-LB
 
This is all that's in the QuarterToPrint formula
Code:
formula = 0
Somehow it knows the quarter and the part
Code:
 ({@QuarterToPrint} - 1) * 3 + [i][b]1[/i][/b]
is showing the 1st month in the current quarter, etc ...

Yes on the latter. Amount fields are specific to each month. Since it's the total of the deductions paid in the month showing.
 
I couldn't see the end of your formulas on my iPad, so thought the three formulas were the same. Sorry.

In design mode, select all fields/labels in column1 in design mode, and then go to format field->suppress->x+2 formula area and enter:

month(currentdate)<>({@QuartertoPrint}-1)*3+1

Repeat for each of the remaining two columns, changing the last digit to +2 and +3 respectively. Then the suppression will work regardless of the month of the currentdate.

-LB
 
THANK YOU!
It seems to be working, it's showing only the February column and the data for February now.
 
Hi Ibass,

So for some reason the March column text is not showing and the entire column for Amount is not showing.
Only the data for Hours in March are showing.

This is the code for the fields for March
only difference is the +3 at the end for handling March

Code:
month(currentdate)<>({@QuartertoPrint}-1)*3+3

and now it's April, it's not showing it in the 1st two columns

The columns are broken up by Quarter
each quarter it should reset

Q1 should show
Jan hours Jan Amounts in Feb
Feb hours Feb Amounts in Mar
Mar hours Mar Amounts in Apr

So currently, it would show Mar hours and Mar Amounts since it's Apr now
then next month, in May, it should show Apr hours and Apr Amounts in the Jan fields, etc ...

AND the ability to show prior month. is there a way to prompt that?
 
Check the suppression on the hours to make sure the formula is consistent with the other fields in that column.

If you want to show the previous month, then the formulas should be changed. Replace month(currentdate) with: month(dateadd(‘m’,-1,currentdate)). Be sure to type in your own quotes around the ‘m’, since my iPad character set doesn’t use the quotes recognized by Crystal.

I don’t understand why the QuartertoPrint formula is set to 0. I think this should be set to the quarter of interest, using a parameter instead.

-LB
 
Yes, checked on the 2x Suppression and they are consistent with the other fields. Why I don't understand it's not showing. Will triple check.

It is showing Mar Amounts, just not the header or the hours for Mar with the month(current)

And they would like to enter a specific month to view at anytime. So a parameter prompt on the Month?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top