Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Need to count with multiple variables

The below pics is where I get the data, but in the final report it will be a direct connect

In the second pic it displays what I need to count. and the third pick shows where in my app I need it to be.

In the first pic need to not include the MOPs circled in red

second pic is an example of what I need to count

Third pic is the output area in my sheet

The attached file is a small sample of the data I added a column called count that is only showing what should be counted  Only four still need to be adjudicated.

1 Solution

Accepted Solutions
rupamjyotidas
Valued Contributor

Re: Need to count with multiple variables

Can you show me your Script

Maybe the below with bracket would work out

if((Match(MOP,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj = 0 )or

(Match(MOP2,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj2 = 0),1,0) as Flag

6 Replies

Re: Need to count with multiple variables

Sorry, your explanation doesn't make sense. If I select only the records without the MOP values you listed I end up with a lot more records than the four you say should be left over. What other selection conditions that you have not mentioned should also be applied?


talk is cheap, supply exceeds demand
Not applicable

Re: Need to count with multiple variables

This is what I was thinking but could not figure out how to make it work

 

If MOP is not ('FACI','PRIV','GUAR','CASH','CHRG','INV')
and
ElecAdj = 0
Count RxNo
If MOP2 is not ('FACI','PRIV','GUAR','CASH','CHRG','INV')
ElecAdj2 = 0

Count RxNo

rupamjyotidas
Valued Contributor

Re: Need to count with multiple variables

Make a Flag in the Script

if(Match(MOP,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj = 0 or

Match(MOP2,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj2 = 0,1,0) as Flag


then your expression is

Count({<Flag={'1'}>} RxNo)

Not applicable

Re: Need to count with multiple variables

Picking up to much still  I think part of it is because it dos not like the blank in MOP2

See row 2 and row 9 for two examples

rupamjyotidas
Valued Contributor

Re: Need to count with multiple variables

Can you show me your Script

Maybe the below with bracket would work out

if((Match(MOP,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj = 0 )or

(Match(MOP2,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj2 = 0),1,0) as Flag

Not applicable

Re: Need to count with multiple variables

I think something is missing

In the example I believe it is counting ElecAdj2

I think I need IF MOP2 is blank do not count ElecAdj2

    if((Match(MOP,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj = 0 )or

(Match(MOP2,'FACI','PRIV','GUAR','CASH','CHRG','INV')<1 and ElecAdj2 = 0),1,0) as Flag,

Community Browser