Hello, friends, I need help!
In the aggregate there is the Basket column which is the result of multiplying PriceItemAvg with the ValorNacional column but it does not allow me to generate a SUM, would there be a solution for this case in the aggregate or would I need to do it via SQL?
Hi Fernando,
do you want to add the entire Basket column? 10.14 + 12.51 + ... and output the entire value? that is not going to be possible. You already have grouped the aggregate by products which is why it doesn't let you. Replace this with an sql or in the after fetch of the aggregate do a for each and add the Basket column
According to the guidance of my friend Juan Echegaray
I used For Each and managed to solve it, I tried to create a SQL query but I found it very complicated.
I really appreciate everyone's help!
Hello,
You can share your oml?
I can do what you want
@Paulo Torres error is in the GetBaskets aggregate !
Don't know well if I reproduced what you want but check the oml.
It seems The oml didn't upload, WebSite problems. I'll add later!
Explaining the GetBaskets aggregate:
the Label column is a group of items (E.g Coffee, Tomato...) as it can have more than one entry with the same label.
The PriceItemAVG column is the average of the PriceItem column type decimal, the ValorNacional column is data type decimal and finally the Basket column takes the value of the PriceItemAvg and multiplies it by the ValorNacional.
I would then like to make a Sum in the Basket column to generate the value of the basic basket.
The aggregate has a filter by city and by month/year to show the monthly value of the basic food basket in an expression, which is why there is a group in the label and there can be more than one data collector for prices in the market.
I did an example!
Hi,
Unable to build your project as there is missing CS module. But for realizing your case created one Entity with 2 fields Number1 and Number2. Added new column in aggregate named Total. Then just right clicked on it and able to use SUM from there to get the sum of all values in Total column.
so its doable easily. For your case it will be great if you can share missing dependencies of it so that can check at my end.
regards
The community here is great, I'm going to share the core module but I believe that what the colleague above mentioned runs into my problem because I grouped the column, I can't add it
Does your employer or customer really want you to share their Intellectual Property here? And if this is for training, does your trainer really want that you offload your knowledge building to the community. Cause, what do you learn when other solve you problem and you just import it back into your code?
If you share an OML make sure that it is a Proof of Concept of only the problem at hand. That it does not show any details of the project you are working on. That will make the solution also very clear for you and because it is separate you will need to move the solution back to your project yourself. And by doing this you will learn.
Hope this helps,
Vincent
Sorry, I just tried to help so you could better understand the problem, I didn't know I was violating a forum rule.
I apologize !