Skip to main content

#Orders0 人正在讨论

My shop takes Credit Card payments and the % fees depend on monthly sales volumes.

I have built a KPI Sheet, which gives me the cost per transaction including the credit card fees.

 

What I would like to do is the following:

calculate the fixed Volume for any given month which is then used to calculate the percentage Fees.

 

I am already doing this in a monthly view where I basically calculate the days completed in that month, and then extrapolate my numbers for the full month. i.e. on day 15 in a 30 day month, I would calculate "current volume x 2" for the full month.

 

Once I switch to Daily or Weekly, those volumes don't work anymore, because I keep multiplying the period's volume by 2, Instead of taking the total volume of 15 days again...

 

Here are the forumlas I am using:

 

To calculate the days in any full month:

AVG(DAY(DATEADD('day',-1,DATEADD('month',1,DATETRUNC('month',[created])))))

 

To calculate the days completed in a given month:

If MONTH([created]) = MONTH(TODAY()) AND YEAR([created]) = YEAR(TODAY()) THEN DAY(TODAY()-1)

ELSE 

DAY(DATEADD('day',-1,DATEADD('month',1,DATETRUNC('month',[created])))) 

END

 

Calculate the multiplier of the actual volume:

1/(AVG([Days Completed in given Month])/[Days in full Month])

 

To calculate the full month applicable Orders

[Sales]* [Full Month Multiplier]

 

How do I "not" calculate that Sales Volume for the selected period but for the days completed in the respective month?

6 个回答
  1. 2022年12月21日 13:13

    Thanks - but I would like to see how you approached the problem and the loss you created

    you can look to https://jimdehner.com/2022/09/06/calculating-averages-or-rates-how-to/ on calculating averages or rates - several examples including some using lods

    When you have your workbook with fake date and your approach available please return and post it here as a twbx

    Thanks

    Jim - Tableau Visionary

0/9000

We have Orders over 72000 and I configured Invoice scheduler to run daily but it keeps failing with error message "Apex CPU time limit exceeded".

 

When I reached out to salesforce support, they said, we have to partition these orders into different buckets using blng__InvoiceBatch__c picklist and run multiple invoices. That means, I have to partition Orders into 10 (or 15) batches and have 15 Invoice schedulers run every day.

 

I know that Invoice scheduler internally is implemented by Apex Batch and Apex Batch should handle easily 72000 records, unless there is a bug in that Apex batch that runs behind Invoice scheduler.

 

Problem with partitioning orders into different batches are as follows:

  1. Every new order that is created should have a batch assigned..we have to implement that.
  2. We should schedule multiple Invoice schedulers targeting different batches and we also have to make sure that these batches don't run in parallel(otherwise we could run into locking issues).

What I prefer is :

 

Fix the Apex batch behind Invoice scheduler so that it doesn't run into Apex CPU time limit errors. We don't care, if it takes too long.

 

Anyone ran into these issues? 

 

This makes us think that we are the first biggest company that is implementing Billing package and running into all sorts of these issues but we are not, we have close to 200 users.

8 条评论
  1. 2022年5月17日 01:26

    @Ramesh Ale No, I am not saying we cannot process 72,000 orders in a single apex job. What I am saying is: we cannot assume because an apex job can process 72,000 records, we can process 72,000 orders without running into any limit issues. The CPU limit is applied to each batch of records. If a batch of 200 records exceed asynchronous apex CPU limit of 60 seconds, the batch will run into Apex CPU Time Limit exceeded error. One way to avoid this is to tweak the batch size to a lower number.  You are right about running smaller batches will take longer for the job to complete and also will run into record locking issues. However, please read the guidelines for invoice run. Reducing the batch sizes will slow invoice run speeds but reduces the chance of errors from batches with many invoice lines

     

    If we reduce batch size, to mitigate the slow invoice run speeds, we can take advantage of running multiple invoice schedulers by carefully designing the approach. For example, you can setup once batch for accounts starting with letter A to M and another scheduler for accounts starting with letter N to Z. We need to have some automation on orders to update blng__InvoiceBatch__c, which is used in invoice scheduler to pick the orders matching with the batch.

     

    It will be helpful to have a full sandbox to experiment and tweak your approach. You also need to evaluate any other custom automations that are getting triggered causing the limit issue. All these contribute towards the 60 second CPU limit for a batch of records.  

0/9000

I have completed 95% of this dashboard but unable to move to the next step. The bottom of the interaction part where the metrics parameters should be done. Don't know how to approach it. can someone help me or guide me with this. The dashboard part.Its a doubt that i stuck here for an 2 days

3 个回答
0/9000
3 个回答
  1. 2023年11月20日 22:32

    Has anyone gotten this to work? I created a new cartridge with /cartridge/templates/default/order/orderdetails.isml and /cartridge/templates/default/order/paymentdetails.isml but they are not being invoked when I lookup an order. The only one I can see working is /cartridge/templates/default/order/printorderinvoice.isml (which is called when you click the Print Order button)

0/9000

Hello,

 

I have a flow that takes an order record and if it contains specific products (Apple and Banana) it then deletes those products off the original order and creates an 

 

#Flow #Orders #Automation order for each product.

 

The flow has been working fine for a few weeks but now it fails. After it creates a new order for Banana it fails to create one for Apple. It says " Error Occurred: This error occurred when the flow tried to create records: DUPLICATE_VALUE: duplicate value found: Customer_reference_number__c duplicates value on record with id: 8016900000EDHlU. "

 

Customer_reference_number__c is set to require a unique value. In my flow, I have the new orders reference codes set to be entered as 'Original reference_Banana' or 'Original reference_Apple'. I can see in my flow it has used the correct name for both the new banana and apple orders. I also see that the salesforce record ID's are unique as well.

 

So I don't understand why it's failing, or more interestingly why it has started to fail now. Any advice?

7 个回答
0/9000

So , I am trying to find number of sales [in my case its the countd(order_id)] .

I want to find if less than 10% of customer sales came within last 20 % of its Existence then that customer is inactive .

4 个回答
  1. 2022年2月24日 00:38

    Hello , so I am attaching a lookalike data file in excel format , but my original data has huge number of rows .

    Basically here new_min_date is the last 20% of date of max_date in date format. I got that by using above formula I mentioned . In that 20_existence is INT(exsistence)*0.2

0/9000

Hi Team,

 

In my attached workbook I have three view in Dashboard.

 

But I have some challenges here listed

 

1) View 1 has Dimention has Hierachy, so user can expand and collpase from Region to State and City.

But If they do so Above text boxes that is created to group the measures are getting disaligned.

 

Example Group A Box should be on top of #Orders, #People and #Returns

Group B box on top of Discount and Profit

Group C Box on Top of Profit Ratio, Quantity, Sales

 

At first level this alignment correct, but if user expand to Region->State-> then it get disalligned.

 

Any workaround for this?

 

2) With expand and collapse below table measures also getting disaligned, example #Orders should be in one line for all the tables,

#People should be in one line for all the views etc. But everything getting disalinged when we expand or collpase. Any workaround for this?

1 个回答
  1. 2021年12月30日 23:03

    Hi Nilanjan,

     

    With Drill down on one view and with static dimension on the below view, it is not possible to have the alignment of the measures on the dashboard or of the text boxes.

     

    One work around I got is, on the first dashboard, we can have text boxes and measure names aligned on both the views. And, we can have an action on sheet 1 on select to pass it to the detailed view with drilled down values

     

    Regards,

0/9000

I community, 

 

By default, when there is a change of account owner, the owner of orders in draft status also changes. Is there any way to avoid this?

 

Thanks a lot! 

 

Geoffrey 

 

#Sales Cloud #Order Management #Orders 

3 个回答
  1. Ines Garcia (get: Agile) Forum Ambassador
    2021年11月22日 15:47

    What you can do is an after the fact process

0/9000

#B2B Lightning #Orders  The related record(s) Order Lookup displays the Order Number. This creates confusion since the Order Number has no relevance to our external system(s).

4 个回答
  1. 2021年11月18日 16:40

    Hi Suraj, thanks for the detailed response.

    Unfortunately there are other areas where we have no options to include the Order Name (such as child External Objects and Detail Pages).

    This won't be a viable solution.

0/9000

Is there something I can do to limit a product to one order at a time?

 

For example - Product A is already associated with Order 1.

 

I create order 2 and try to select Product A but it will not let me. I have to select a different product. 

 

If this can be done I also need to be able to close Order 1 once complete and Product A then becomes available for selection again...

 

I can't work out if my brain isn't working properly or I'm trying to get blood out of a stone! 

 

#Order Management  #Order Products  #Orders

3 个回答
  1. 2021年10月22日 10:40

    Hi,

     

    Sorry for taking so long to reply. No I don't think this helps as we're not using quotes, just orders. Unless I need to implement another step to create what I'm trying to do. I think my problem lies within the product itself. 

     

    To create the order you need to select a product - I want this product to be only associated with this order whilst the order is in progress. Once the order is complete, I want to be able to select the same product again (but only once the first is complete and not in progress). 

     

    Eventually I need to be able to run a report to see 'All Products'  and 'All products available/not available' (available meaning they are not associated with a live order. 

     

    Hope this explains a bit more what I'm trying to achieve. 

0/9000