Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sweens78
Creator
Creator

error on percentage expression

Hi Folks,

 

I have the below expression that I am trying to get a pertage for and it keeps coming back with an error, is it a bracket?

 


num((Count({<SubstanceMisuseAlsoAFactor={'1'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'1'}>} PatientsNotAssessed_ID))
+
(
Count({<SubstanceMisuseAlsoAFactor={'2'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'2'}>} PatientsNotAssessed_ID))
+
(
Count({<SubstanceMisuseAlsoAFactor={'3'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'3'}>} PatientsNotAssessed_ID))) 
 

/

((
Count(NEWKEYID)-Count(PatientsNotAssessed_ID)),'##.#'))

1 Solution

Accepted Solutions
sweens78
Creator
Creator
Author

Great stuff, just had to put an extra bracket around the divisional part and it worked  see below

 

=num(Count({<SubstanceMisuseAlsoAFactor={'1'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'1'}>} PatientsNotAssessed_ID)
+
Count({<SubstanceMisuseAlsoAFactor={'2'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'2'}>} PatientsNotAssessed_ID)
+
Count({<SubstanceMisuseAlsoAFactor={'3'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'3'}>} PatientsNotAssessed_ID)

/

((Count(NEWKEYID)-Count(PatientsNotAssessed_ID)),'##.#%'))

View solution in original post

3 Replies
jyothish8807
Master II
Master II

Try this:

num((Count({<SubstanceMisuseAlsoAFactor={'1'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'1'}>} PatientsNotAssessed_ID))
+
(Count({<SubstanceMisuseAlsoAFactor={'2'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'2'}>} PatientsNotAssessed_ID))
+
(Count({<SubstanceMisuseAlsoAFactor={'3'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'3'}>} PatientsNotAssessed_ID))) 
 

/

((Count(NEWKEYID)-Count(PatientsNotAssessed_ID)),'##.#')

 

Just removed your last bracket.

Best Regards,
KC
Frank_Hartmann
Master II
Master II

Maybe this:

=num(Count({<SubstanceMisuseAlsoAFactor={'1'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'1'}>} PatientsNotAssessed_ID)
+
Count({<SubstanceMisuseAlsoAFactor={'2'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'2'}>} PatientsNotAssessed_ID)
+
Count({<SubstanceMisuseAlsoAFactor={'3'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'3'}>} PatientsNotAssessed_ID)
 
/

(Count(NEWKEYID)-Count(PatientsNotAssessed_ID)),'##.#')

hope this helps

sweens78
Creator
Creator
Author

Great stuff, just had to put an extra bracket around the divisional part and it worked  see below

 

=num(Count({<SubstanceMisuseAlsoAFactor={'1'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'1'}>} PatientsNotAssessed_ID)
+
Count({<SubstanceMisuseAlsoAFactor={'2'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'2'}>} PatientsNotAssessed_ID)
+
Count({<SubstanceMisuseAlsoAFactor={'3'}>} NEWKEYID)-Count({<SubstanceMisuseAlsoAFactor={'3'}>} PatientsNotAssessed_ID)

/

((Count(NEWKEYID)-Count(PatientsNotAssessed_ID)),'##.#%'))