Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kishorj1982
Creator II
Creator II

condition not working

Hi all,

the below condition is not working.Please suggest

Pick(match(Search_Type,'C','CP','CX','C','CP','CX',''),'Active','Active','Inactive','All','All','All','All') as ActiveInactiveFlag,

19 Replies
arvind_patil
Partner - Specialist III
Partner - Specialist III

HI Kishor,

I think neha.shirsath‌ is right her code is  working lets check:

test:

LOAD * Inline [

Search_Type

C

CP

CX

]

;

LOAD *,

If(wildmatch(Search_Type,'C','CP'),'Active',

If(wildmatch(Search_Type,'CX'),'Inactive')) as ActiveInactiveFlag

Resident test;

DROP Table test;

Concatenate

LOAD * Inline

[

Search_Type, ActiveInactiveFlag

C,All

CP,All

CX,All

];

Thanks,

Arvidn Patil

effinty2112
Master
Master

Hi Shraddha,

There's something not right here:

Pick(Wildmatch(Search_Type,'C','CP','CX','C','CP','CX',''),'Active','Active','Inactive','All','All','All','All') as ActiveInactiveFlag


If you want a wildmatch you need to use wildcards in your expression so the expression knows exactly how to compare strings. We need to be careful, if you replace 'C' with 'C*' for example then if Search_Type = 'CP' the wildmatch function will not return 2 but 1 because 'C*' is a wildmatch with 'CP'.


Instead of trying to return a value of 7 for a wildmatch with '' take out the '' parameter and add 1 to the wildmatch and rearrange your pick selections.


So instead of something like

Pick(Wildmatch(Search_Type, 'A*','B*','C*',''),'A...','B...','C...', 'Nothing')

do

Pick(1+Wildmatch(Search_Type, 'A*','B*','C*'),'Nothing','A...','B...','C...')


Good luck


Andrew

kishorj1982
Creator II
Creator II
Author

I have concatenated the tables this is not working for all tables.

thanks

kishorj1982
Creator II
Creator II
Author

Hi Tresco,

Thanks for the response.But I am  not able to understand how it works in my scenario.

Thanks

kishorj1982
Creator II
Creator II
Author

This condition is not working for the tables where i used concatenation.

Thanks

kishorj1982
Creator II
Creator II
Author

Hi Anil,

This condition is not working.

Thanks,

tresesco
MVP
MVP

It would require script modification. Try to share a sample qvw with inline data to mimic your scenario where we can work upon to give you heads-up.

neha_shirsath
Specialist
Specialist

Okay. It should work, Can you share your sample data set?

kishorj1982
Creator II
Creator II
Author

PFA.

Values of all is not matching , whenever I am clearing all selection sum(collection amount) is displayed as per requirement.

Thanks

Anil_Babu_Samineni

May be helps Qlik Community Tip: How to Get Answers to Your Post

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful