Qlik Community

Ask a Question

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 
Search instead for 
Did you mean: 
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
Specialist
Specialist

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

View solution in original post

6 Replies
Gysbert_Wassenaar

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
Author

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
Specialist
Specialist

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
Author

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
Specialist
Specialist

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

View solution in original post

Not applicable
Author

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,