Forum Discussion
calculate columns from two tables
Hello everybody,
I have a problem, can you help me?
I have 2 tables; an information and a data table.
I want to calculate a new column like in the example. Is that possible?
Example:
| articel | articel_statsitic |
| 10 | 0 |
| 11 | 0 |
| 1010 | 10 |
| 1011 | 11 |
| articel | order | sales |
| 10 | 0 | 5 |
| 11 | 0 | 4 |
| 1010 | 15 | 0 |
| 1011 | 20 | 14 |
solution:
| articel | order | sales | order_New |
| 10 | 0 | 5 | 15 |
| 11 | 0 | 4 | 10 |
| 1010 | 15 | 0 | -15 |
| 1011 | 20 | 14 | -20 |
5 Replies
- camargos88Community Champion
Anonymous ,
Sorry, I didn't get the logic for that. Can you explain more ?
- AnonymousNot applicable
camargos88 i´m sorry for that 😉
Sorry.
I try something else:If the articel has deposited a statistical articel, then the orders should be booked to the statistical articel.
Table 1 states: Article 1010, Article 10 as a statistical article.
That's why I have to add up all the values of article 1010 to article 10
- camargos88Community Champion
Anonymous ,
So the relations are always 1 to 1 ?
And the values that's giving should be multiplied to -1 ?
- AnonymousNot applicable
No, unfortunately not. There are many articles with the same stored statistical articles.
- daxCommunity Support
Hi Anonymous ,
I am not clear about your requirement, could you please explain the logic of [order_new] column? If possible could you please inform me more detailed information(such as your expected output and your sample data)? Then I will help you more correctly.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.