Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a number of if statements like below,
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),'ZERO','NOT ZERO') as STATUS,
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),0,BEG_BAL) as BEG_BAL_1,
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),0,END_BAL) as END_BAL_1,
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),0,ACTIVITY) as ACTIVITY_1
Could you please suggest how to move ahead to get the optimize results.
Thanks in advance!!
Thanks
I'm not quite sure what you mean but you wouldn't need to do the check for each field else you may use a preceeding load like:
load *, pick(Check, 'ZERO', 'NOT ZERO') as STATUS, pick(Check, 0, BEG_BAL) as BEG_BAL_1, ...;
load *, if(wildmatch(...) or index(...)>1, 1, 2) as Check from Source;
Whereby if there are many of such matchings I would in general look to avoid and/or minimize them and/or to apply rather join/mapping/association approaches as creating duplicate information in extra fields.
- Marcus
Hello Experts,
Can you please suggest on this.
Thanks in advance!!!
Thanks
@sunny_talwar - Please help
Hello,
Create a flag for the values which match with your conditions in your statements (especially second one). Create a LOAD INLINE table (with your criterias ) and use it like a mapping table (Applymap()) . I hope it'll be helpful for you.
Regards.
Thanks for your inputs.
Can you please share an example for the same?
Take a look on the following postings:
Mapping … and not the geographical kind - Qlik Community - 1494869
What is a Mapping Load in Qlikview - Qlik Community - 1481005
and be not impatient if you need a few days to go through all possibilities carefully. Mapping is an essential way of categorize, clean, flag or match the data and usually also the easiest and most suitable & performant approach for it. So it's worth to comprehend the logics.
- Marcus
Hi Marcus,
Thanks for the valuable response. For the below code, is it possible to create the calculated column in the resident load for WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*') and use the same in the script.
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),'ZERO','NOT ZERO') as STATUS,
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),0,BEG_BAL) as BEG_BAL_1,
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),0,END_BAL) as END_BAL_1,
if(WildMatch(PLSR_Footnote_temp,'*D*') OR (INDEX(PLSR_Footnote_temp,'*')>1),0,ACTIVITY) as ACTIVITY_1
Please suggest
I'm not quite sure what you mean but you wouldn't need to do the check for each field else you may use a preceeding load like:
load *, pick(Check, 'ZERO', 'NOT ZERO') as STATUS, pick(Check, 0, BEG_BAL) as BEG_BAL_1, ...;
load *, if(wildmatch(...) or index(...)>1, 1, 2) as Check from Source;
Whereby if there are many of such matchings I would in general look to avoid and/or minimize them and/or to apply rather join/mapping/association approaches as creating duplicate information in extra fields.
- Marcus