Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : SP_Report - ProfitandLossStandard with total column excludedSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC Reporting Forum

 New Topic 
 
 Post Reply 
[1]  
 SP_Report - ProfitandLossStandard with total column excluded 
 Author   Message 
  SWT 
  
 Group: Members 
 Posts: 20 
 Joined: 2006-11-09 
 Profile
 Posted : 2008-10-25 02:28:00

Is it possible to run a ProfitandLossStandard report and have the total column excluded?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-25 10:04:14

Sure, try:

sp_report ProfitAndLossStandard show Text, Label, Amount_1 as Amount, Amount_1_Title as "As of"
parameters DateMacro = 'ThisMonthToDate', SummarizeColumnsBy = 'TotalOnly'
where RowType <> 'SubtotalRow'

See: How do I run a Profit & Loss Standard Report? for more.

 

  Top 
  SWT 
  
 Group: Members 
 Posts: 20 
 Joined: 2006-11-09 
 Profile
 Posted : 2008-10-25 10:12:58

So, if i where to run the following code, I would like the total column to be excluded.  Right now it returns 10 amount columns (the 10th being the total column) but I would like it to return only nine amount columns.

 

sp_report ProfitAndLossStandard show 'IS' as Report,'AdCafe' as Company, AccountType, Label as Natural_Account, Amount  parameters DateFrom = {d '2008-01-01'}, DateTo = {d '2008-09-30'}, SummarizeColumnsBy= 'Month' where RowType = 'DataRow'

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-25 13:40:50
The where RowType = 'DataRow' clause has already filtered out the SubtotalRow, TextRow and TotalRow rows. There are no totals, it must simply be an account you called Total. 

  Top 
  SWT 
  
 Group: Members 
 Posts: 20 
 Joined: 2006-11-09 
 Profile
 Posted : 2008-10-25 15:47:15
That is correct, there are no row totals, but my original question was how to exclude the total column. Is there a way to get rid of the 10th amount_10 column? I would like the query to return only 9 amount columns and I can't figure out a way to do this as the result always gives me 10 columns, the 10th being a total column. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-26 10:10:27

OK, in this example where I have 12 month amount columns and the Total Column:

sp_report ProfitAndLossStandard show Text, Label, Amount_1_Title as Month_1, Amount_1,
Amount_2_Title as Month_2, Amount_2, Amount_3_Title as Month_3, Amount_3,
Amount_4_Title as Month_4, Amount_4, Amount_5_Title as Month_5, Amount_5,
Amount_6_Title as Month_6, Amount_6, Amount_7_Title as Month_7, Amount_7,
Amount_8_Title as Month_8, Amount_8, Amount_9_Title as Month_9, Amount_9,
Amount_10_Title as Month_10, Amount_10, Amount_11_Title as Month_11, Amount_11,
Amount_12_Title as Month_12, Amount_12, Amount_13_Title as Total, Amount_13 as Total_Amount
parameters DateMacro = 'ThisYear', SummarizeColumnsBy = 'Month'

I simply remove Amount_13:

sp_report ProfitAndLossStandard show Text, Label, Amount_1_Title as Month_1, Amount_1,
Amount_2_Title as Month_2, Amount_2, Amount_3_Title as Month_3, Amount_3,
Amount_4_Title as Month_4, Amount_4, Amount_5_Title as Month_5, Amount_5,
Amount_6_Title as Month_6, Amount_6, Amount_7_Title as Month_7, Amount_7,
Amount_8_Title as Month_8, Amount_8, Amount_9_Title as Month_9, Amount_9,
Amount_10_Title as Month_10, Amount_10, Amount_11_Title as Month_11, Amount_11,
Amount_12_Title as Month_12, Amount_12
parameters DateMacro = 'ThisYear', SummarizeColumnsBy = 'Month'

 

  Top 
  SWT 
  
 Group: Members 
 Posts: 20 
 Joined: 2006-11-09 
 Profile
 Posted : 2008-10-27 01:20:49
Thanks for that, that does work. But, is there a way to have it done while using input from the user? I will be running this report and asking for a Beginning and End date range. Sometimes the results will only bring back 1 month while other times it may bring back 23 months. Each time I would like "no" total column to be returned. Is it possible to get rid of the total column while using a "parameter of DateFrom and Date To? I don't believe it is possible but just want to make sure I am not missing something. See my original query: sp_report ProfitAndLossStandard show 'IS' as Report,'AdCafe' as Company, AccountType, Label as Natural_Account, Amount parameters DateFrom = {d '2008-01-01'}, DateTo = {d '2008-09-30'}, SummarizeColumnsBy= 'Month' where RowType = 'DataRow'  

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-27 08:01:31

No, it's up to you to work out how many months the inputed DateFrom and DateTo span. But that's why we have these predefined DateMacro options available:

|All|Today|ThisWeek|ThisWeekToDate|ThisMonth|ThisMonthToDate|ThisQuarter|ThisQuarterToDate
|ThisYear|ThisYearToDate|Yesterday|LastWeek|LastWeekToDate|LastMonth|LastMonthToDate|LastQuarter
|LastQuarterToDate|LastYear|LastYearToDate|NextWeek|NextFourWeeks|NextMonth|NextQuarter|NextYear|

so you can pre-determine the number of columns for each of the formats as I have done with DateMacro = 'ThisYear' above.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to