IIF Statement

Discussion forum about all things Report Builder (all versions).

IIF Statement

Post by avent » 13 Apr 2011, 20:25

Runnng Report Builder 2005...

Have a break group called Resource ID. The footer of this group has 1 line with a SUM field that adds up "Required Qty"
If the Resource ID = ABC or DEF ... I want to see the SUM(Required Qty) line , if it does not, I do not want to see that line .

I cannot figure out how to create this in the conditional display area. Any help would be greatly appreciated.



Re: IIF Statement

Post by avent » 14 Apr 2011, 15:30

HELPPPPPPPPPPPPPPPPPPPP. urgent... Jeff .. any suggestions at all???????????????


Jeff Luther

Re: IIF Statement

Post by Jeff Luther » 14 Apr 2011, 17:59

You need to put together a test case for this, Al. As I mentioned when you called the support hotline, that's helpful for both you and to post here so someone can look at it.

Posts: 272
Joined: 06 Mar 2017, 22:41
Location: Mackay QLD Australia

Re: IIF Statement

Post by TerryP » 14 Apr 2011, 23:25

Hi Al,

If I'm understanding your question correctly, you just need to create a ReportBuilder formula that determines if the Resource ID item value is either 'ABC' or 'DEF', and select that formula in the conditional display field. Unfortunately, there's no Decode function in RB, so the formula itself is a bit unwieldy:

Code: Select all

NumberIFF( StrCompare( ResourceID, 'ABC' ), 0, 1, 0 ) + NumberIFF( StrCompare( ResourceID, 'DEF' ), 0, 1, 0 )
Of course, if the report is based on a database query, you may be able to calculate the value in the query and pass it in as a report item, e.g. (for SQL Base):

Code: Select all

@DECODE( ResourceID, 'ABC', 1, 'DEF', 1, 0 )
Hope that helps, :)
Terry Phythian
Reprise Consulting

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests