Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the folowing dataset
MonthPart | Company | OrderID | Volume in KG | Volume in ltr |
15.819 | 31.122 | |||
1 | Dummie | 5113A1080555 | 2.090 | 4.111 |
1 | Dummie | 5174A1084003 | 305 | 600 |
1 | Dummie | 5175A1084027 | 441 | 868 |
1 | Dummie | 5180A1084257 | 305 | 600 |
1 | Dummie | 5187A1084647 | 362 | 712 |
1 | Dummie | 5187A1084701 | 1.252 | 2.464 |
1 | Dummie | 5187A1084715 | 293 | 577 |
1 | Dummie | 5187A1084720 | 610 | 1.200 |
1 | Dummie | 5188A1084740 | 483 | 950 |
1 | Dummie | 5189A1084780 | 483 | 950 |
1 | Dummie | 5195A1085169 | 525 | 1.033 |
2 | Dummie | 5191A1084782 | 2.927 | 5.758 |
2 | Dummie | 5197A1085316 | 3.304 | 6.500 |
2 | Dummie | 5201A1085458 | 2.439 | 4.799 |
Now i want a a aggr over the Orderid for the Volume in Ltr
So i can make the folowing calculation
If Volume in ltr for a order >5000 then volume /1000 *62.79 else volume /1000 *91.29
My result must be 2492 as total costs. But my aggr without the orderid dim doesn't work. Anybody an idea?
Hi Drik.
please try below expression
Sum(Aggr(sum(if([Volume in ltr]>=5000, [Volume in ltr]/1000*62.79, [Volume in ltr]/1000*91.29)),OrderID))
I am unsure why you would need aggr here there OrderID is Lowest Level so
Sum(if([Volume in ltr]>5000,([Volume in ltr]/1000)*62.79,([Volume in ltr]/1000)*91.29))
Yes, use a straight table, and do not use "Expression Total" but use "Sum of Rows" in the Expression Tab
for each orderid he has calculate if the total order is >5000. and then i know which Tarief ineed to choose.
Then i don't need the orderid in my table and can i calculate my total costs.
My result should look like
Company total litres total costs
Dummie 31.122 €2492
sum(if([Volume in ltr]>=5000, [Volume in ltr]/1000*62.79, [Volume in ltr]/1000*91.29))
and I have 2492
May by your problem is ".' betweeen numbers?
for each orderid i have to calculate if the total is above 5000
then i need a result table with te total costs.
With a orderid in the table it works with every formula. But i only want a total result.
How is that possible?
There is only one row per orderID so why do you need to aggr?
As I told you before the problem is only due to totals because the expression, when computed on total has only 1 value (that is the total). This is the reason for which total must be computed as sum of all rows not as single expression
Let me know
I have 14 orders
From that orders i have to know the total costs
For each order id i need to now the total volume.
If the volume for an order is above 5000 then that volume from that order *tarief 1 else that volume from that order for 8 tarief to.
The caclulation has to be displayed als a total volume in a row without the orderids,
More simple then that i can't make my question
As we can see each order has one row in your dataset.
What do you mean telling us total volume?
Do you have rows for items in the orders in you data model?