Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
SDeLa131
Contributor III
Contributor III

Need help on a formula when comparing for two things that must match

count({$<[VCODETAIL_Credit Reason] = {'009','010','011','012','013','014','015','016','017','018','019','020','022','023','036','037'}, [VCODETAIL_Credit Person] = {'AL','AF','AS', 'CD','DF','EB','EW','HS','KMK','MO','MS','MG','MJ','MF','RB','RC','SR','SW'}>} [OrderHeader Count])

 

above is the formula, but its only counting for the credit reason codes but its not pulling from the right credit person that is found in the file VCODETAIL.  Why?

 

Labels (1)
  • Cloud

2 Replies
mpc
Partner Ambassador
Partner Ambassador

Hi, 

Maybe this one:

count({$<[VCODETAIL_Credit Reason] = {'009','010','011','012','013','014','015','016','017','018','019','020','022','023','036','037'}>+ <[VCODETAIL_Credit Person] = {'AL','AF','AS', 'CD','DF','EB','EW','HS','KMK','MO','MS','MG','MJ','MF','RB','RC','SR','SW'}>} [OrderHeader Count])

(Set operators | Qlik Sense on Windows Help) Since + is the union operator

Best

From Next Decision and mpc with love
marcus_sommer

If both fields and their values needs to be evaluated in common a set analysis isn't suitable else an if-loop will ne necessary, maybe like:

if(match([VCODETAIL_Credit Reason],
   '009','010','011','012','013','014','015','016','017','018','019','020','022','023','036','037') and
   match([VCODETAIL_Credit Person],
   'AL','AF','AS', 'CD','DF','EB','EW','HS','KMK','MO','MS','MG','MJ','MF','RB','RC','SR','SW'), count([OrderHeader Count]))