If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
I have following fields:
Article No, Branch no, Quantity, cost price
I want to calculate the total value so
SUM(Quantity * cost price) in a KPi
but when I calculate the same line by line and then the total in Excel I can see that the value calculated with the function SUM is much higher and wrong.
I'm a beginner and I have no ieda
I'd suggest including some sample data, but generally speaking, something like this suggests duplication of the data either at the source or through incorrect joins. You should be able to check this by applying e.g. count(Quantity) and see if that matches the expected number of lines.
Here is a simplified data and as you can see the total value in the Kpi is the double of the correct one that you can get summing the values in the table
Please note: in the Sum function FISALD = Quantity and Kostpris = Cost price
If this value is exactly double what it should be, the issue is almost certain to be a duplication of some sort. However, I can't tell you what it is based on the image you've shared. As I mentioned above, you should perhaps count the different fields individually and see if anything is showing up with more than three values in this scenario. If one of these values is from a different table from the others, that would be the first thing I'd check, as duplication is often a result of incorrect keys/joins.