Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jespermiles
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
shraddha_g
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
shraddha_g
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?

jespermiles
New Contributor

Re: Yes / No scores conditioned on Yes scores

Hi Shraddha,

Here is a photo of the data.

dummydata Qlik - Launis.PNG

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.

shraddha_g
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?

jespermiles
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,

bwisealiahmad
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.

shraddha_g
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?])

jespermiles
New Contributor

Re: Yes / No scores conditioned on Yes scores

This worked perfectly. Thank you!