Oracle ATG: New payment group issue, amount of the payment group has invalid values - atg

I have added a new PaymentGroup for our Ecommerce site for store-points redemption based on the documentation.
After submitting an order (store points + cash), I could see that the final amount of the store points PaymentGroups is incorrect.
It seems the amount is a cumulative sum of the points amount of previous orders.
When debugging I saw following in PaymentGroupFormHandler.applyPaymentGroups() method, List commerceIdentifierPaymentInfos = container.getAllCommerceIdentifierPaymentInfos();
This list contains the PaymentInfo of the previous order as well. So, the pgm.recalculatePaymentGroupAmounts(order) gives a cumulative summation of previous points redemptions.
Still I couldn't find the root cause for this. Any help would be appreciated.

Related

Calculate a running total that works with relative date filters

I have a Union table of my various bank accounts to create a personal finance analysis dashboard.
I am trying to make a Running Total to show my total capital available at any given date. Using a Running Total table calculation works, just as much as using a RUNNING_SUM() calculated field. They both work up until I filter the dates. So I am trying to find a way to make the running calculation work without being thrown off by Date Filters (I would like to implement relative dates for visualisation in the dashboard).
My union table has the following relevant data columns:
Order ID: Descending number from 1 for each entry per account.
Date: Date of entry.
Item: Entry name.
Account: Name of bank account.
Amount: +ive for credit or -ive for debit.
Balance: balance after entry value for each given account.
So the table can look like this:
So on 07/05/2019 the Running total should be 229.64.
The running sum formula mentioned above is currently RUNNING_SUM(SUM([Amount])), so if any dates are excluded via filter the running total doesn't add up to the right amount.
A way I can see around the problem could be to get the sum over all accounts of the last balance reading at a given date. The balance is a running total but only if the final entry per time period for all accounts are summed would it work. Would it be possible to make a calculated field that gets the last balance reading for each account at any given date and then sums them?
Or is there a simpler smarter way I am not aware of?
This comes down to an Order of Operations problem. Once you filter the dates the viz doesn't have access to the data anymore.
Your best approach would be to add the running sum to the data source before you bring it into Tableau. Then the running sum isn't a calculated field dependent on the data in the Viz.

How to summarize an if/then/else formula in CR

I have a formula which calculates the commission earned by a salesperson. We store our invoices under each salesperson, so it's easy to separate them. I need a way to summarize this formula, and I can't use either a running total or a summary because each customer has a different commission rate per pound sold. Currently, the formula to calculate what rate the commission should be applied something like this:
if {cust.custnum} = "101010" then .0250*sum(#metal lbs, {invoice.invoicenum})
else if etc.
where {#metal lbs} is a formula that has to be used as an intermediary to get the weight of the metal on the invoice, and looks like this:
IF {INVOICELINEDETAIL.GLCode} = "METAL " THEN
{INVOICELINE.Wt}
ELSE
0
Sorry for the lengthy post, but I'm trying to give as many pertinent details as possible.
If you group by customer and then also group by invoice number then you could put your summary in the customer footer, would that work for you?
Another thought is I believe in running total you can set a formula for the evaluation so maybe you could use the nested if there and achieve what you need?

Static column in tableau but rest all columns dynamic with filtering

I am building a tableau dashboard which has month, region, and account type filter. (Account type can have only two values either New account or old account)
The table in the report should have the following columns:
Month,
Region,
Clicks,
Signups.
Now the issue is clicks are independent of the account type and signups is dependent on the account type.
I am required to create a static clicks columns i.e when a user filters on account type then only signups column numbers change but clicks remain the same.
I have tried multiple ways to create this table but I am unable to reach a solution to this. I also tried creating two workbooks- one with just a clicks column and the other workbook with rest of the columns. After which, I pasted them together side by side in a dashboard. But the formatting looks extremly off and not professional.
Could you please guide me as to how I can achieve this?
You can use a level of detail expression. These are calculated prior to any dimensional filters and therefore will be unaffected by these actions:
Create a calculated field as follows:
{ FIXED [Month], [Region]: sum([Clicks]) }
This will calculate the sum of the clicks per month and region and ignore any filtering on account.
Let me know if this gives your desired result or if we need to refine further.

Need to Display Information that Has Been Sorted Out

I am still rather new to Crystal Reports and have what feels like a pretty basic question. I work at a school, and part of my duties are to help with donation reporting. My boss wants a report that gives her biographical(irrelevant to this) information about donors that gave 500 or more to our Booster fund(relevant).
The kicker is this: After using record select to sort for donors who have given more than 500 to this fund, I need to show how much they have given to other funds as well. The way I've tried to do it has given Crystal parameters to only display the data if giving exceeds 500 to booster fund. Here's the record select:
{gift.fiscal_yr} = 2015 and
{gift.campaign} = "Booster" and
{gift.amount} >= 500
After it runs through that, when I put {gift.campaign} on the actual report, it only shows "Booster", and not any others. I want it to show me the giving amount of all funds only if the donor has given 500 or more to Booster.
Thanks in advance for your help! This community is a life saver!
Off the top of my head try this:
Take booster out of selection formula as suggested.
I assume you are grouped on donor?
Create a formula #findboosterdonor
if {gift.campaign} = "Booster" then 1 else 0
Go to Report-Selection-Formula-Group
enter this with your field names
sum(#findboosterdonor,{donor}) > 0

Crystal reports - Group total

I have a report that I've written and I understand how to create running totals and such, but need help creating a custom evaluation formula.
I have two levels of groups, first group is based upon a certain user, the next group is based upon transactions that user has been involved in. I have details hidden, and am only interested in the totals for a particular activity. This is working great, and totals are working properly but the problem is, each activity has a 'line number', which essentially can be the same as another activity (ie: two activities can have lines 1, 2, 3 contained within), so doing a distinctive total based upon a set of data isn't accurate because I only want it to be distinct based upon each individual recordset, and not globally.
The example is below... if I do a count on each record for this dataset, it comes out to 18 because there are duplicate line numbers on each... but if I do distinct, it only comes to 9 because of duplicate line numbers across multiple actives.
I guess what I need to know is how I can take the totals per detail group, and have them total up in my second footer properly. I assume it's going to take me compiling together a string including the activity number and line number, and then comparing them?
Here is an example of the data contained within the total groupings:
I figured this out on my own... turned out it was pretty simple. I converted my numeric values to text, and included a copy of the transaction id and the line id as my test value, and did distinct on that... Sometimes it just helps not staring the problem down.