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
Summary Expressions
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Summary Expressions
Hello,
Please send us a sample report with test data that reproduces the issue for analysis.
Thank you.
Please send us a sample report with test data that reproduces the issue for analysis.
Thank you.
Re: Summary Expressions
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
Thanks
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
Thanks
- Attachments
-
- Report (4) (1) (1).mrt
- (35.78 KiB) Downloaded 85 times
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Summary Expressions
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?
Thank you.
Re: Summary Expressions
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.
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.
- Attachments
-
- Screenshot 2022-11-30 115049.png (31.89 KiB) Viewed 883 times
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Summary Expressions
Hello,
You can use the following expression:
{SumIf(DataBand2,DataSource2.Calls,DataSource2.WeekEnding == DateTo)}
Thank you.
You can use the following expression:
{SumIf(DataBand2,DataSource2.Calls,DataSource2.WeekEnding == DateTo)}
Thank you.
- Attachments
-
- Screenshot 2022-11-30 093145.png (196.17 KiB) Viewed 874 times