Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Duplicate Issue

I have joined some tables together and notice that i have duplicates: i need to be able to somehow compress these values to only show the instance happening once (because it did not actually occur 3 times). The answer should say 123456 = 75, not 225 which is what it is currently showing me.

Any thoughts?

Item#          Final Fcst          Qty

123456          75                    4

123456          75                    6

123456          75                    13

Thanks,

Parrish

4 Replies
Gysbert_Wassenaar

Try using sum(distinct [Final Fcst]) instead of sum([Final Fcst])


talk is cheap, supply exceeds demand
Not applicable
Author

I would stick to average in this case

avg([Final Fcst])

kouroshkarimi
Creator III
Creator III

I'm assuming the Qty field is causing the table to segregate like that. If that table is in the front end then change Qty to sum(Qty).

If it's in the script, then you'll need to introduce a group by clause. e.g.

table a:

load [Item],

     [Final Fcst],

     sum(Qty)

resident mytable

group by

      [Item], 

     [Final Fcst]

;

Not applicable
Author

Hi,

Try this

(Answer You get)/Count( [Final Fcst])