Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead 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]

View solution in original post

10 Replies
brian_booden
Partner Ambassador
Partner Ambassador

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.

brian_booden
Partner Ambassador
Partner Ambassador

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

brian_booden
Partner Ambassador
Partner Ambassador

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]

brian_booden
Partner Ambassador
Partner Ambassador

Glad this helped you to get what you needed.  Please mark as answered or helpful, if you get the chance.

Not applicable
Author

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

brian_booden
Partner Ambassador
Partner Ambassador

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

Regards,

Brian