Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I'm new to Qlik and have been facing issues with aggr distinct sum. When I use below function to calculate the selling price, I get different number to the actual selling price. Its really strange and difficult to figure out what possibly could be wrong.
selling price = sum(aggr(sum(distinct selling price),competitor, material))
Competitor | Material | Actual Selling Price | Selling Price |
A | 1 | 1995 | 1953 |
B | 1 | 1995 | 1953 |
C | 1 | 1995 | 1953 |
A | 2 | 234 | 230 |
B | 2 | 234 | 230 |
C | 2 | 234 | 230 |
Why the Aggr()? Why not Sum(SellingPrice) or Avg(SellingPrice)?
-Rob
I only need to see distinct values when calculating the totals. Sum will give me dups and avg will take avg of entire sales which I don't want
You have multiple occurrences of selling price? You seem to be taking care of that with Sum(Distinct...
I'm not understanding your data. Can you post some sample data?
-Rob