Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a problem in loading script. I don´t know what is wrong.
In a QVD file with several columns I want to apply SUM function.
let´s say:
Year Product PRV Amount
2014 prdA A 24720
2014 prdB A 24720
I do apply SUM function like this:
FINAL_QVD:
load PRV,SUM(Amount) as SAmount from QVD.qvd (qvd)
group by PRV;
Finally, when I create a Table from FINAL_QVD I get this:
PRV SAmount
A 98880
Instead of:
PRV SAmount
A 49440
Diego,
it's going to be difficult to work out what's going on here, but it certainly looks like you have duplicates.
You could try adding count(Amount) to see if this is the case.
I'd suggest that you need to look at the code that's creating your original QVD.
Marcus
Diego,
it's going to be difficult to work out what's going on here, but it certainly looks like you have duplicates.
You could try adding count(Amount) to see if this is the case.
I'd suggest that you need to look at the code that's creating your original QVD.
Marcus
the distinct field is product, so either you add it as part of your group or you apply a distinct to your sum
FINAL_QVD:
load distinct PRV,SUM(Amount) as SAmount from QVD.qvd (qvd)
group by PRV;