Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

As per your dashboard Data i m getting coorect.

Plz checkCapture.PNG my screen Shot.

arulsettu
Master III
Master III
Author

thats y taking distinct. any other way to get right value

arulsettu
Master III
Master III
Author

any ideas?

Anonymous
Not applicable

Hi

Please try to check value for one age_band at DB & QV.

I think all the values displayed in the reports are correct.

Please check value for Age_band 0-6 in DB.

AGE COUNT( {<[AGE] ={0,1,2,3,4,5,6}>} DISTINCT EMPLOYEE_ID)
14433
02139
12903
23058
33051
42980
52944
62688
Not applicable

Hey,

try the intervallMatch-Functionality of QlikView, this seems like a perfect problem for IntervallMatch.

You won´t need all thoses IFs there.

jagan
Luminary Alumni
Luminary Alumni

Hi Arul,

If the employees has more than one age band then the employee is counted twice, to overcome this you have to flag the max age records and then create the age band.  Like this you can eliminate the duplicate records.

Regards,

Jagan.

arulsettu
Master III
Master III
Author

can you please tell me how to do it. this my expected below there please check

MarcoWedel

Hi,

maybe also helpful:

Custom Filter(unusual range)

QlikCommunity_Thread_184962_Pic1.JPG

regards

Marco

arulsettu
Master III
Master III
Author

Hi Macro,

               can you please share how to do this with my sample app.

Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi Arul,

Share some sample data and your expected output, so that it would be easier to provide solution.

Regards,

Jagan.