Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Rich_Talbot
New Contributor

Expression Not Calculating

Can anyone tell me what is wrong with the following expression:

=Count({<$(vNumber)={'Strongly agree'}>}$(vNumber)
/
Count({<$(vNumber)={'Strongly agree','Agree','Disagree','Strongly disagree'}>}$(vNumber)

 

i am trying to work out the percentage of strongly agree answers out of total responses. 

I am trying to create a variable so i can flick between the questions however the above formula is not calculating

Labels (2)
3 Replies
anushree1
Valued Contributor

Re: Expression Not Calculating

')' seems to be missing at the end, could you try this:

=Count({<$(vNumber)={'Strongly agree'}>}$(vNumber))
/
Count({<$(vNumber)={'Strongly agree','Agree','Disagree','Strongly disagree'}>}$(vNumber))

Rich_Talbot
New Contributor

Re: Expression Not Calculating

Yeah that fixed the formula but it still isn't calculating, i think there is something wrong with the variable 

Highlighted
MVP
MVP

Re: Expression Not Calculating

As you say there may be a problem with the variable. I suggest that you outline what is in that variable, and how it is created, perhaps with some sample values. If it's a field name, then does it need to be enclosed with delimiters (eg the field name contains spaces)?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein