# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for
Did you mean:
Not applicable

## 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]})

1 Solution

Accepted Solutions
Not applicable
Author

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]

10 Replies
Luminary Alumni

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

Not applicable
Author

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.

Luminary Alumni

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

Not applicable
Author

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

The Syntax hasn't worked

Many thanks

Victory

Luminary Alumni

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

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

Regards,

Brian

Not applicable
Author

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]

Luminary Alumni