|
Is it possible to group the report per company? If so, could you try a formula like
if {command_1.eventid} = {?comparisoneventselect} and {command_2.event_id} = {?event base select} then 'REPEAT' else
if {command_2.event_id} = {?event base select} then 'BASE YEAR' else
if {command_1.eventid} = {?comparisoneventselect} then 'NEW' else ' '
If not, could you provide some detail about your tables?
Edited by Gurbs - 30 Jun 2014 at 11:22pm
|
|
Thanks for the reply -
I want to group by event and not the company unless I have to do so in order to get the results I want. Below is the TSQL command file that selects the initial data set for the report. I then have two parameters to identify the two events I want to analyze and then use them in a record select to narrow the results. I do not have the parameters at the command file level as I want to present the user with a dynamic list of events form the DB to use in making their selection -
SELECT
InvoiceLineItem.InvoiceNum
,InvoiceLineItem.Item
,InvoiceLineItem.ItemNum
,InvoiceLineItem.Amount
,InvoiceLineItem.EventSignUpID
,EventSignUps.ProfileID
,Profile.ReportName
,EventList.EventName
,EventList.EventId
,InvoiceLineItem.Descr
,(CASE
WHEN Adjustments.AdjustmentAmount IS NULL
THEN 0
ELSE Adjustments.AdjustmentAmount
END) AS Adjustment
FROM InvoiceLineItem
LEFT JOIN EventSignUps ON InvoiceLineItem.EventSignUpID=EventSignUps.EventSignUpID
LEFT JOIN EventList ON EventSignUps.EventID=EventList.EventId
LEFT JOIN Profile on EventSignUps.ProfileID=Profile.ProfileId
LEFT JOIN Adjustments ON InvoiceLineItem.InvoiceNum+InvoiceLineItem.LineItemID=Adjustments.InvoiceNum+Adjustments.InvoiceLineItemID
WHERE
InvoiceLineItem.Item LIKE 'EV_%'
AND (InvoiceLineItem.Descr LIKE '%sponsor%'
OR InvoiceLineItem.Descr LIKE '%exhibit%' OR
InvoiceLineItem.Descr LIKE '%contribut%')
AND EventList.EventDate>='01/01/2010'
ORDER BY EventList.EventID
|