Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

count is not correct

hi i am trying to count the policy so did like this

count(distinct employee_id).

and dimension is age band

like this

if(ME_AGE>=0 and ME_AGE<=6,'0-6',

     if(ME_AGE>=7 and ME_AGE<=18,'7-18',

     if(ME_AGE>=19 and ME_AGE<=30,'19-30',

     if(ME_AGE>=31 and ME_AGE<=45,'31-45',

     if(ME_AGE>=46 and ME_AGE<=60,'46-60',

     if(ME_AGE>=60,'60')))))) as age_band

but the result getting is not correct. while checking in db output is little differs in qlikview.

here i attached a sample app please check and let me know what i am doing wrong.

50 Replies
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Which count you are saying about

arulsettu
Master III
Master III
Author

count(distinct employee_id).

ChennaiahNallani
Creator III
Creator III

Hi,

Use this

if(ME_AGE>=0 and ME_AGE<=6,'0-6',

     if(ME_AGE>=7 and ME_AGE<=18,'7-18',

     if(ME_AGE>=19 and ME_AGE<=30,'19-30',

     if(ME_AGE>=31 and ME_AGE<=45,'31-45',

     if(ME_AGE>=46 and ME_AGE<=60,'46-60',

     '60'))))) as age_band

arulsettu
Master III
Master III
Author

expected output is

 

 

14594 0 to 6
15088 7 to 18
61451 19 to 30
74968 31 to 45
24283 46 to 60
2423 above 60
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

what is your out put ?

arulsettu
Master III
Master III
Author

check the sample app

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

IN YOUR FIRST CHAT DIMENSION IS CLASS(Age,6) , CHANGE IT TO age_band.



REGARDS,

Nagarjna

arulsettu
Master III
Master III
Author

i changed the app now

avinashelite

Hi Arul,

I checked your file, problem is with the data. the same Employee_ID has more than one age attached to it to quote an example check 035 because of this your not able to get the right count.