The requirement is to print the customer statement without credit memo and pre payment. I have modified the report and added a filter condition to filter only invoices and it works fine.
I am facing an issue in the ageing where the total is not tallying and it included the credit memo and prepayment.
I have tried to recalculate the values and it is not working.
How do I recalculate the ageing which considers the newly added filter condition?
I tangled with this report once and it was a tough exercise. My requirements were different,but in the end I had to tinker with how the variables within the report are calculated based on the data. In the report designer, click on the sections and then click into the variables collections under properties. You can see how the balances are summed and edit the code, put in if statements,etc. Hope that's helpful.
The have followed the below steps
Declared variable for each ageing group in detail band and the value will be reset on document group.
Declared a variable AgeingDays and calculated the date difference between statement date and document due date
=DateDiff( 'd', [ARStatementDetailInfo.DueDate],[#StatementDate] )
Used the following statement to find out the ageing group and stored the value
=$cagb00+Iif($AgeingDays < [ARStatement.AgeDays00], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
=$cagb01+Iif($AgeingDays >= [ARStatement.AgeDays00] And $AgeingDays <[ARStatement.AgeDays01] , IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
=$cagb02+Iif($AgeingDays >= [ARStatement.AgeBalance02] And $AgeingDays < [ARStatement.AgeBalance03], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]) , 0 )
=$cagb03+Iif($AgeingDays >[ARStatement.AgeBalance03] And $AgeingDays < [ARStatement.AgeBalance04], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
=$cagb04+Iif( $AgeingDays >= [ARStatement.AgeDays04], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
Declared another set of variable on to sum the value of group level
Finally while printing ageing value, check the flag invoice only and if it is true print the calculated value otherwise the default value
=Iif([#InvoiceOnly], $ca01, $CustAgeBalance01 )
I have tested and my test result are good.
Related
I am trying to extract some data out of a large table of data in Excel. The table consists of the month, the agent's name, and either a 1 if they made a sale or a 0 if they did not.
What I would like to do is plug in a Month value into one cell, then have it spit out a count of how many agents made their first sale that month.
Sample Data and Input Output area
I found success by creating a secondary table for processing a minif and matching to agent name, then countif in that table's data how many sales months matched the input month. However I would like to not have a secondary table and do this all in one go.
=IF(MINIFS(E2ERawData[Date Group],E2ERawData[Agent],'Processed Data'!B4,E2ERawData[E2E Participation],1)=0,"No Sales",MINIFS(E2ERawData[Date Group],E2ERawData[Agent],'Processed Data'!B4,E2ERawData[E2E Participation],1))
=COUNTIFS(ProcessedData[Month of First E2E Sale],H4)
Formula in column F is:
=MAX(0;COUNTIFS($A$2:$A$8;E3;$C$2:$C$8;1)-SUM(COUNTIFS($A$2:$A$8;"<"&E3;$C$2:$C$8;1;$B$2:$B$8;IF($A$2:$A$8=E3;$B$2:$B$8))))
This is how it works (we'll use 01/03/2022 as example)
COUNTIFS($A$2:$A$8;E3;$C$2:$C$8;1) This counts how many 1 there are for the proper month (in our example this part will return 2)
COUNTIFS($A$2:$A$8;"<"&E3;$C$2:$C$8;1;$B$2:$B$8;SI($A$2:$A$8=E3;$B$2:$B$8)) will count how many 1 you got in previous months of the same agents (in our example, it will return 1)
Result from step 2, because it's an array formula, we sum up using SUM() (in our example, this return 1)
We do result from step 1 minus result from step 3 (so we get 1)
Finally, everything is inside a MAX function to avoid negative results (February would return -1 because there were no sales at all and agent B did a sale on January, so it would return -1. To avoid this, we force Excel to show biggest value between 0 and our calculation)
NOTE: Because it's an array formula, depending on your Excel version maybe you must introduce pressing CTRL+ENTER+SHIFT
If one has got access to the newest functions:
=LET(X,UNIQUE(C3:C9),VSTACK({"Month","Total of First time sales"},HSTACK(X,BYROW(X,LAMBDA(a,SUM((C3:C9=a)*(MINIFS(C3:C9,D3:D9,D3:D9,E3:E9,1)=C3:C9)))))))
apologies for this, I'm assuming this is simple but a few hours of SO googling hasn't helped
Enough whining from me:
Consider the following dataset:
ID, Date, Review, Review Status
1 01/02/18, "Cool", Positive
1 01/03/18, "Awesome", " Positive
1 01/01/18, "Cumbersome", Negative
1 01/02/18, "Rubbish!", " Negative
I'm currently using an array type index match to get the latest review based on a few conditions
I have two columns one which says positive, one negative.
in each of the column I would like to return the latest positive review but I'm unsure how to get the max date within the below formula:
{=index(C2:C4, MATCH(1,(1 = A2:A4)*("Positive" = D2:D4)*(maxdatehere = B2:B4),0))}
The data I have is around 7k rows and is Google Review Data and pretty much matches the example above.
I'd rather not use VBA as I've never really used it before (but will do so grudgingly)
as this is excel I've not created a google demo sheet, but happy to do so for ease of the experts and for others to benfit if they find there way here one day.
If you have Office 365:
=INDEX(C2:C5, MATCH(1,(1 = A2:A5)*("Positive" = D2:D5)*(MAXIFS(B:B,A:A,1,D:D,"Positive") = B2:B5),0))
Confirme with Ctrl-Shift-enter instead of Enter when exiting edit mode.
If you have 2010 or later then:
=INDEX(C:C,AGGREGATE(15,7,ROW(C2:C5)/((A2:A5=1)*(D2:D5="Positive")*(AGGREGATE(14,7,B2:B5/((A2:A5=1)*(D2:D5="Positive")),1)=B2:B5)),1))
Entered normally.
I have 2 worksheets:
Worksheet 1: Member ID, Engagement Date and other data.
Worksheet 2: Member ID, Policy Begin Date, Policy End Date and other data.
On Worksheet 1, I want to return a policy type name (from Worksheet 2), if Worksheet 1's Member ID matches Worksheet 2's Member ID AND if Worksheet 1 Engagement Date falls between Worksheet 2's Policy Begin and End Date...
The following is the formula I tried and also have attempted extensive research, to no avail:
=INDEX('Program Data'!M2:M25671,MATCH(A2:A489&F2>='Program Data'K2&F2<='Program Data'L2,'Program Data'!E2:E25671,0))
Replace your MATCH with an AGGREGATE that Calculates the SMALLest row where the Policy ID and Dates all match up.
So, we want AGGREGATE(15, 6, <SOME CODE>, 1) to get the Smallest non-error value in a list created by <SOME CODE>
The first thing that <SOME CODE> will want is the ROW we are looking at (minus one, because I see that you are skipping the header row...) which is ROW(Sheet2!$A$2:$A$25671)-1
If the Row does not match, we want to either make it massive or make it error (even better, because then it gets completely skipped). How to do this? Well, I have the POWER function for that. If you try POWER(10,999) you get a #NUM! error, because 10^999 is too large a number for Excel. If you try POWER(0,999) you get 0, because 0^anything is 0. So, we'll just add some POWER to our ROWs to make it error-out when we don't want them.
But, now we need to decide between 10 and 0. Fortunately, Logical statements can be treated as Bitwise Multiplication (True = 1 and False = 0`)
So, --(Sheet2!$A$2:$A$25671=$A2) will give us 1 when the First Columns (Member ID) match, --(Sheet2!$B$2:$B$25671<=$B2) will make sure that the Policy Start Date is before-or-on the record date, and --(Sheet2!$C$2:$C$25671>=$B2) will check the End Date. Multiply it all together, and we get 1 when the row matches, and 0 when it doesn't.
Now, if we take that away from 1, we get the opposite: 0 when we want 0, and 1 when we want 10. So multiply that by 10, and shove it in the POWER function, and add that to the ROW to get <SOME CODE>. Dump it all in the AGGREGATE from the start, and voila
=AGGREGATE(15,6,ROW(Sheet2!$A$2:$A$25671)-1+(POWER(10*(1-(Sheet2!$A$2:$A$25671=$A2)*--(Sheet2!$B$2:$B$25671<=$B2)*--(Sheet2!$C$2:$C$25671>=$B2)),999)),1)
Then, just use that in place of your MATCH (it will generate a #NUM! error when no policy is found)
=INDEX(Sheet2!M2:M25671,AGGREGATE(15,6,ROW(Sheet2!$A$2:$A$25671)-1+(POWER(10*(1-(Sheet2!$A$2:$A$25671=$A2)*--(Sheet2!$B$2:$B$25671<=$B2)*--(Sheet2!$C$2:$C$25671>=$B2)),999)),1),1)
I have a problem that I cant figure out how to solve. currently I am solving this in excel but eventually be using sql.
We have a survey which is meant to run when the billed amount reaches ;
•first trigger $50k, then $150, then $250.
Sample Data
'last run' is when the survey last ran and 'Current Value' is the current billed amount.
So for row 1 , the survey last ran when billed amount was 55000 and now it is 160000 which is greater than the threshold 150K so survey should run hence it should return 'true'.
Row 2 : is also true because current value is greater than 'last run and also 'is >= 150K
Row 3: is also true because it has passed the threshold of 150K
Row 4 : should return false because between last ran and current value there isn't any threshold passed.
If
CurrentValue >= Last Run
And Current Value >= 50K or 150K or 250K
then 'True' Else false
We are going to drive the survey Initiation from the true or false returned from this.
The data is only sample data , values for current and last run can change but the trigger amounts will remain the same.
any help would be appreciated.
I understand your question this way:
You want to calculate which trigger the last Run value was checked against, and which trigger the Current Value is checked against, and if they are different and the Current Value is greater than last Run then we need to run the survey again (return TRUE), otherwise we don't (return FALSE).
If the above understanding is incorrect, please let me know.
To calculate this I would simply build one IF-statement expression that determines which trigger that last Run used, and the same for Current Value, and compare them.
Here are the two formulas:
=IF(A2>=250000;3;IF(A2>=150000;2;IF(A2>=50000;1;0)))
=IF(B2>=250000;3;IF(B2>=150000;2;IF(B2>=50000;1;0)))
Then we need to put it all together, so here's the final formula:
=AND(
IF(A2>=250000;3;IF(A2>=150000;2;IF(A2>=50000;1;0)))
<>IF(B2>=250000;3;IF(B2>=150000;2;IF(B2>=50000;1;0)))
;B2>A2)
(remove linebreaks and put it all together on one long line)
While automating testing of a website shopping experience, I am attempting to verify that the subtotal, total, and tax are calculating properly. Since the price and/or tax will change in the future, I cannot simply assert the actual price value inside the control. Instead, I would need to build a calculation based upon the controls themselves and assert that quantity multiplied by individual price for each item added together equals the subtotal, and so on.
For example, say my controls for each are named such (control names are in asterisks):
Quantity = *UIItem2Cell*
(InnerText has a Value of 2)
Individual Price = *UIItem249Pane*
(DisplayText has a value of 2.49)
Individual Product Total (price x qty) = *UIItem498Pane*
(InnerText has a Value of 4.98)
Instead of validating the values are the actual numbers, can I write an assertion formula using the identifiers as variables?
Keep in mind, I am using the Coded UI Test Builder rather than writing the code outright.
If the Individual Product Total InnerText assertion comparator is AreEqual, can the Comparison Value be something like:
UIItem2Cell-InnerText * UIItem249Pane-DisplayText
A. Is this sort of formula possible?
B. If so, how do I write it?
(Please forgive me, as I am very green when it comes to this.)
You most certainly can. First off in your app itself it would be greatly useful to use IDs on your controls so you can match on just that criteria. that way your not using calculated values for search criteria.
Now as is in your question you will need to pull those values from the cells, calculate the Value and use it in your Search Criteria
// I'd recommend trimming text values:
// depending on how tables and such are rendered you'll have extra white-space characters
var firstValue = Double.Parse(UIItem2Cell.InnerText.Trim());
var secondValue = Double.Parse(UIItem249Pane.DisplayText.Trim());
var calculatedValue = string.Format("{0,N2}%", firstValue * secondValue);
// assuming your in a web app
var totalDiv = new HtmlDiv(currentHtmlDoc);
totalDiv.SearchProperties.Add(new PropertyExpression(HtmlDiv.PropertyNames.InnerText, calculatedValue, PropertyExpressionOperator.Contains));
Assert.IsTrue(totalDiv.TryFind());
SringAssert.Contains(totalDiv.InnerText,calculatedValue);