Average in Cross-Tab

I made a report by Cross-Tab to show sales amount per shop per date. In Grand Total, I wish to show the average amount instead of sum total. But I found it often happens error, I guess it should be caused by Null value when some shops haven't sales amount the date. Any method to avoid that?

Thanks a lot!

Comments

  • gpigpi
    edited 6:40PM
    Try to set TfrxReport.EngineOptions.ConvertNulls to True
  • edited 6:40PM
    yes. I'd set ConverNulls to True already. But it seems not work.
  • gpigpi
    edited 6:40PM
    Can you attach modified report from FRDemo with problem?
  • edited 6:40PM
    jlshk wrote: »
    I made a report by Cross-Tab to show sales amount per shop per date. In Grand Total, I wish to show the average amount instead of sum total. But I found it often happens error, I guess it should be caused by Null value when some shops haven't sales amount the date. Any method to avoid that?

    Thanks a lot!
    If you are using a query to extract the data then you may be able to convert nulls to any other value in it.
    For Firebird it would be
    SELECT COALESCE( ColumnValue, 0 ) FROM Table

    returning 0 if ColumnValue is null.
  • edited 6:40PM
    Thank you for your answers. I success to converted the Null value to zero. But another question happen, my boss require the zero amount should not be counted in average. Is it possible to do that?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.