Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
can you tell me how can I divide with 2 tables ?
example:
Tab1:
Load DocNo,
ArtNo,
Cost, // here are amounts that costs with discount like: 550€ & -50€
Quantity, //here are all quantity like 25 and 25
FROM ..
Now I want to sum(cost)/sum(quantity).
Is it possible to use it in script?
Backend in expressions, it works.
You have to use group by
Load DocNo,
ArtNo,
sum(cost)/sum(quantity)
FROM ..
Group by //Include all columns other than cost and quantity
DocNo,ArtNo
Hi
Try like this
Load DocNo, ArtNo, Cost, Quantity, Cost/Quantity As Percentage From ... ;
You have to use group by
Load DocNo,
ArtNo,
sum(cost)/sum(quantity)
FROM ..
Group by //Include all columns other than cost and quantity
DocNo,ArtNo
You can do as below
1)
Tab1:
Load DocNo,
ArtNo,
Cost,
Quantity,
Cost/Quantity as YourNewFieldName
FROM ..
2)
Tab2:
Load
DocNo,
ArtNo,
SUM(Cost)/SUM(Quantity) as YourNewFieldName
Resident Tab1
Group By DocNo, ArtNo...
But the 1st Method is more efficient...