10 Replies Latest reply: Jan 22, 2015 8:36 AM by Victory Obi

# Does anyone know how to write an expression in Qliksense to formulate a Ratio?

I'm looking to work out a percentage in the expression box, Qliksense doesn't believe its right but I'm fully convinced it's fine

Count({[MUDID] [WHERE] [Logged In?] / (Count [MUDID]) = ["Yes"] * [100]})

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Hi victory,

That syntax will not work in Qlik Sense, probably you need to use set analysis.

Can you explain a bit more what you are trying to calculate?  It's not really that clear from the syntax you provided.

Regards,

Brian

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Hi

I am creating a dashboard based on users who have logged into a system. The excel file I imported has a list of the users, their MUDID's (which is basically their ID) and the countries they're from and whether they've logged in or not. I am now trying to find the percentage of users who have logged in based on the how many users are in that country.

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Create a Table with the Dimension [WHERE]

Create a Measure with the below syntax using Set Analysis, which will be something like this:

Count ({<\$[Logged In?]={'True'}>} [MUDID]) / Count ([MUDID])

Not sure what is stored in your [Logged In?] field in terms of data.

Set the Number Formatting property of the Measure to Number, Formatting to Simple, and pick the 12% option in the dropdown.

Regards,

Brian

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Hi Brian, what is stored in the Logged In field is Yes or No.

The Syntax hasn't worked

Many thanks

Victory

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Sorry, got my syntax slightly wrong - try this instead:

Count ({\$<[Logged In?]={'Yes'}>} [MUDID]) / Count ([MUDID])

Regards,

Brian

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Hi Brian, thanks for the syntax, I made a few chances to your syntax and it's worked now. This is what worked: Count ({<[Logged In?]={'YES'}>} [MUDID]) / (Count ({<[Logged In?]={'YES'}>} [MUDID]

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Ok thanks. I'm very new to this community, how do I do that please?

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

In each reply on the discussion, you can mark it as Correct or Helpful.

Regards,

Brian

• ###### Re: Does anyone know how to write an expression in Qliksense to formulate a Ratio?

Ok thanks