Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

wildmatch in expression

i have this expression 

 

count(if(wildmatch(sm_no,'US*'),left(sm_no,9),amount_lc))

in that condition i am trying to get the sm_no who start with US and extract first 9 digits 

further more i want to add another condition that code =947 so how i add into this 

is this expression is  correct?

 

10 Replies
Shubham_Deshmukh
Specialist
Specialist

You want first 9 digits after that condition or you want count also ? bcoz requirement looks confusing.
Please clear.
capriconuser
Creator
Creator
Author

i want first 9 digits of sm_no and that sm_no should start with US and want count also
Shubham_Deshmukh
Specialist
Specialist

Then why you are taking count of amount_lc?
capriconuser
Creator
Creator
Author

beacuse i need count of amount_lc bases on these conditions which i mentioned above
Shubham_Deshmukh
Specialist
Specialist

That's what I am saying, you want 9 characters starting with US or count ?
Because for getting a count you only need yo use condition of wildmatch() and code =947.
How would we do by using left(sm_no,9) ? it will not act as condition.
capriconuser
Creator
Creator
Author

i want both ,, so how i apply that left condition in set analysis?

Shubham_Deshmukh
Specialist
Specialist

You can use this for getting count,
=Count(if(WildMatch(sm_no,'US*') and code=66,amount_lc))
For count, you can get count OR you can get those 9 char starts with US.

Suppose, you want count of sm_no starting with US(9 char) as per your question, but it will also give same result as it will also contain US.
capriconuser
Creator
Creator
Author

this is not working secondly i want to first 9 digits because there is some inappropriate text in sm_no like this
US0010191KJDKLSAJDJ
US0010191ERKJLEWR
so that why i only want to get first 9 digitis
Shubham_Deshmukh
Specialist
Specialist

You said you also want count