Hey JMills, I have been trying to come up with an answer for you but I feel like I am not understanding the question.
Is it possible for you to provide some more information? Even some dummy data showing what you are trying to accomplish?
This currently can’t be done dynamically in Phocas. You would need to get the value and hard code it in the expression e.g. ((B/A)*100)-33.23 which would be incorrect as soon as you made selections.
It would be great if matrix share mode could be setup like you have your custom mode. They’re close but obviously matrix share doesn’t include the value and the total without a matrix. I’ll put forward a product suggestion for that and a “variance to total”.
The screenshot above shows what I’m looking for. The total line shows what the percentage of sales each product category represents. From the total I want to compare each customer’s percentage of sale so I can see how far away they are from the total piece. This will show me customers who aren’t buying the same % as the best customers. In SQL I would nest this total as a left join and then do a variance from that.
Hang on a mo, I may be barking up the wrong tree, please ignore if I am not understanding your inital requirement. Wouldn’t this get you what you need?
It may be nasty custom code but think its dooable.
@JonKemp good point. Yes it would be possible by dropping into “nasty custom code”. However this functionality is not documented (see Custom Mode) and its use has limited support.
I think the column expression would be something like:
@JonKemp I did read your article first actually but it error’s out when I attempt to do what I’m looking for. If I use @will.marriott formula I get: “An error has occurred when querying the data”
Difficult to support without being on your system. Have a look at the error logs (if you can) as this should tell you what happened to some degree.
When I was struggling with it…and I did … a lot .I would suggest that you break the formula down, using Will’s code, do the first part which is:
^Sum({b}) over()
See what you get, if that works then add the next bit and the next until whammo you get the error. I also will point out that the error could be a DIV 0 error, dividing by zero. I often put this in as well to error proof which is :
NULLIF({a}.0) which this does is makes the returning value become null if its zero, this stops div 0’s in thier tracks
I’m looking for something similar, i,m trying to add Invoice Qty and On Picknote Qty together and then be able to tell me what percentage was invoiced of the total figure, the idea behind it is to see what percentage the warehouse failed to invoice in a day. Any help will be appreciated.
I don’t think you need a statement to accomplish what you’re looking for. You should just be able to add a custom calculation in Custom Mode with the formula Invoice Qty / (Invoice Qty + On Picknote Qty). To show as a nice percentage you might just have to multiple that total by 100.
I do something similar for sales order conversion%:
This is awesome. I am a little stumped on trying to put together a report that shows the customers that make up the top 80% on Total Net Sales. Would it be a custom mode calc?
You are talking about percentage share. it is possible. Two ways is you can simply use the “% share” functionality on your net sales column (if you have one!). Then sort by that column descending…but cannot filter to say greater than equal 80%.