Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikSenseBeginner
Contributor II
Contributor II

Enquiry on dividing a few count expression over count

Hi there, 

I am new to Qlik sense and while doing a mini project I faced an issue.  Hopefully, someone can help me out. 

I have two sets of countsexpression. 

The first set of counts:

Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'},EmploymentRateFullTime={'Employee'}>}EmploymentRateFullTime)+Count({<EmploymentRateOverall={'Working Full-Time in a Permanent job'},EmploymentRateFullTime={'Self-employed'}>}EmploymentRateOverall) - which gave me a value of 3723 when i run it in Qlik Sense.

The second set of count: 

Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Full-Time in a Temporary job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working on a Freelance basis'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Part-Time in a Permanent job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Part-Time in a Temporary job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Accepted job offer and will start later'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Not working but actively looking and available for work'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Taking steps to start a business venture'}>}EmploymentRateOverall) which gave me a value of 4655.  

 

However, when I run the first set divided by the second set (as stated in the formula below) it did not give me a value of  0.81537.  Why it is so. 

Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'},EmploymentRateFullTime={'Employee'}>}EmploymentRateFullTime)+Count({<EmploymentRateOverall={'Working Full-Time in a Permanent job'},EmploymentRateFullTime={'Self-employed'}>}EmploymentRateOverall)/Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Full-Time in a Temporary job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working on a Freelance basis'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Part-Time in a Permanent job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Part-Time in a Temporary job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Accepted job offer and will start later'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Not working but actively looking and available for work'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Taking steps to start a business venture'}>}EmploymentRateOverall)

The number it gave me in Qlike Sense is 4015.  

 

My questions is

1) Does the formula actually work?  am I able to divide a set of count this way?  

2) How do i get the correct value with the dividing of count.   

Labels (3)
3 Replies
chrismarlow
Specialist II
Specialist II

Hi,

Possibly brackets?

(Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'},EmploymentRateFullTime={'Employee'}>}EmploymentRateFullTime)+Count({<EmploymentRateOverall={'Working Full-Time in a Permanent job'},EmploymentRateFullTime={'Self-employed'}>}EmploymentRateOverall))/(Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Full-Time in a Temporary job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working on a Freelance basis'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Part-Time in a Permanent job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Working Part-Time in a Temporary job'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Accepted job offer and will start later'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Not working but actively looking and available for work'}>}EmploymentRateOverall)+Count({$<EmploymentRateOverall={'Taking steps to start a business venture'}>}EmploymentRateOverall))

Cheers,

Chris.

QlikSenseBeginner
Contributor II
Contributor II
Author

Hi Chris, 

Thank you so much for trying.  After some trial and error, I actually have my resolve.  Yours is quite close to what I required.  What I found out is that I must craft the expression in a way that is Set A count expression divided by Set B count expression.  

The expression that works for me is as follow. 

Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'}>+$<EmploymentRateOverall={'Working Full-Time in a Temporary job'}>+$<EmploymentRateOverall={'Working on a Freelance basis'}>+$<EmploymentRateOverall={'Working Part-Time in a Permanent job'}>+$<EmploymentRateOverall={'Working Part-Time in a Temporary job'}>}EmploymentRateOverall)/Count({$<EmploymentRateOverall={'Working Full-Time in a Permanent job'}>+$<EmploymentRateOverall={'Working Full-Time in a Temporary job'}>+$<EmploymentRateOverall={'Working on a Freelance basis'}>+$<EmploymentRateOverall={'Working Part-Time in a Permanent job'}>+$<EmploymentRateOverall={'Working Part-Time in a Temporary job'}>+$<EmploymentRateOverall={'Accepted job offer and will start later'}>+$<EmploymentRateOverall={'Not working but actively looking and available for work'}>+$<EmploymentRateOverall={'Taking steps to start a business venture'}>}EmploymentRateOverall)

Another thing that I observed is that I can substitute ' with [ 

Hope it helps those who require to divide by counting two sets of count.  

 

chrismarlow
Specialist II
Specialist II

Hi,

Looking again I think you can actually simplify further, so all of your sets are EmploymentRateOverall= so you could just list inside one set of {} i.e. EmploymentRateOverall={'Working Full-Time in a Permanent job','Working Full-Time in a Temporary job','etc,}

Cheers,

Chris.