# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor

## Yes / No scores conditioned on Yes scores

Hi,

I have a speedometer, which need to display a score of:

Column A (Yes scores) / Column B (No scores)

But Column B (No scores) needs to only count the answers where they have selected (Yes scores) in Column A and (No scores) in Column B.

At the moment I use

sum(if(match([Var der udsolgte situationer da du ankom?],'Ja'),1,0))/sum(if(match([Er der fortsat udsolgte situationer når du forlader butikken?],'Nej'),1,0))

This will sum every yes score, and every no score instead of conditioning the no scores based onthe yes scores.

Hope this makes sense.

Tags (2)
1 Solution

Accepted Solutions
Honored Contributor III

## Re: Yes / No scores conditioned on Yes scores

try:

Count({<Is the product out of stock at arrival? = {'Yes'}>} [Is the product out of stock at arrival?])/

Count({<Is the product out of stock at arrival? = {'Yes'},[Is the product out of stock at departure?] = {'No'}>} [Is the product out of stock at departure?])

7 Replies
Honored Contributor III

## Re: Yes / No scores conditioned on Yes scores

can you share sample data? on basis sample data can you explain your expected output?

New Contributor

## Re: Yes / No scores conditioned on Yes scores

Here is a photo of the data.

Column A:

Is the product out of stock at arrival?

Column B:

Is the product out of stock at departure?

I want a score of OOS at arrival / OOS at departure. Although, if the product is NOT OOS at arrival, I dont want to include it in the score.

Hope this helps.

Honored Contributor III

## Re: Yes / No scores conditioned on Yes scores

 I want a score of OOS at arrival / OOS at departure. Although, if the product is NOT OOS at arrival, I dont want to include it in the score

Can you elaborate this one?

if(Column A = Yes) then only I have to consider Score of Column B = Yes?

New Contributor

## Re: Yes / No scores conditioned on Yes scores

If(Column A = Yes) divide with If(Column B=No)

In the case of the attached photo, the score would be "1".

The goal is to have a score from 0 to 1.

Where 0 is OOS at arrival, and always OOS at departure.

1 would be OOS at arrival, and never OOS at departure,

Valued Contributor

## Re: Yes / No scores conditioned on Yes scores

Sample data would be good, but sounds like you  need to make an IF statement first to figure out which Column B scores to do and then  do the calculation.

Honored Contributor III

## Re: Yes / No scores conditioned on Yes scores

try:

Count({<Is the product out of stock at arrival? = {'Yes'}>} [Is the product out of stock at arrival?])/

Count({<Is the product out of stock at arrival? = {'Yes'},[Is the product out of stock at departure?] = {'No'}>} [Is the product out of stock at departure?])

New Contributor

## Re: Yes / No scores conditioned on Yes scores

This worked perfectly. Thank you!