Page 1 of 1

Summary Expressions

Posted: Wed Nov 23, 2022 2:08 pm
by tourquse
Hi,

I am trying to write a conditional SumIf expression where the condition compares column values to a variable.

I have gotten as far as the below expression, which returns the value zero. Can anyone please let me know where I have gone wrong?

{SumIf(DataSource2.Sales,DataSource2.WeekEndingDate == DateTo)}

DataSource is my data source.
Sales is the column I'd like to sum. The data type is decimal.
WeekEndingDate is the column I'd like to filter by comparing to a variable. The data type is datetime.
DateTo is my variable. The Data type is datetime.

Perhaps there is a syntax issue or a data type conversion issue with my expression?

Thanks :D

Re: Summary Expressions

Posted: Thu Nov 24, 2022 9:10 am
by Lech Kulikowski
Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.

Re: Summary Expressions

Posted: Sat Nov 26, 2022 3:11 am
by tourquse
Hi, sample report attached. I am aware that there are other ways of solving this problem using filters and bands etc but I would like to solve this entirely within each expression as both a learning exercise and since it aligns with my real-life requirement.

I would like each text box in FooterBand1 to return the desired result that you should be able to understand from the context and my attempt at writing a valid formula :lol:

Thanks

Re: Summary Expressions

Posted: Mon Nov 28, 2022 10:47 pm
by Lech Kulikowski
Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?

Thank you.

Re: Summary Expressions

Posted: Wed Nov 30, 2022 12:51 am
by tourquse
Basically I am having trouble writing the 'Condition' part of a SumIf summary formula (see screenshot).

In the condition I am trying to match column values to a variable. I have checked that the data types are the same in the column and the variable.

The example report I sent through has some formulas in the FooterBand1 which don't return a value because I am not writing my conditions correctly. Can you please help me get those formulas to work.

Re: Summary Expressions

Posted: Wed Nov 30, 2022 8:32 am
by Lech Kulikowski
Hello,

You can use the following expression:
{SumIf(DataBand2,DataSource2.Calls,DataSource2.WeekEnding == DateTo)}

Thank you.