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

Find distinct value when ID is the same

Hi,

I am still a newbie to qlik. I am having a trouble in finding distinct value when the ID is the same for two columns. I am trying to build some hierarchy table where I have several products and their hierarchy with a unique ID. 

I am trying to create a chart which shows the Level 5 with Stock. 

qlikuser22_4-1668507381991.png

 

But my graph looks like this. 

qlikuser22_2-1668507282331.png

I would like to see the Level 5 graph as 10100, 10100 and 10101. 

 

Please help

Thanks in advance!

 

 

Labels (5)
5 Replies
justISO
Specialist
Specialist

Hi, in your chart measure, are you aggregating something? If your provided sample represent your actual data structure, simple bar chart with dimension [Level 5] and measure as sum([Stock]) would work as you need.

qlikuser22
Creator II
Creator II
Author

HI @justISO 

 

Thanks for your reply. I am not aggregating anything. It's just sum(stock) and Level 5.
Any suggestions please?

vinieme12
Champion III
Champion III

can you post a snapshot of your data model?  

 

simply using , below would render the desired chart,

Dimension

=Level5

Measure

=sum(Stock)

 

UNLESS 

1) you are using the TOTAL keyword

sum(TOTAL stock)

2) Your Stock data is not associated to Level5 correctly

and I'm assuming its  point no2

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
justISO
Specialist
Specialist

so if you are using just sum(stock) and [Level5] and getting 30k instead 10k, most probably that you have 3 lines of same level 5 item name. You can try change measure to

Sum(aggr(Stock, [Level5]))

or change dimension to something like

[Unique ID]&[Level5]

and try to find what approach can distinct your rows to get correct stock.

qlikuser22
Creator II
Creator II
Author

Hi 

I tried both and it isn't working 😞