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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

If Not Match in Script Load

My raw data sometimes has a final ';' and sometimes does not. If it does not, I would like to concat it to the end of the value so I can then run the rest of the code but I can't get the first line syntax correct :

 

if( Not FindOneOf(right([EST_NON_PROD_BUILD_HRS]),1), ';'),concat([EST_NON_PROD_BUILD_HRS],';'),

num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'ClinDoc:' , ';' ) )) as SUB_BUILD_NP_EST_CLINDOC,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'Mpage:' , ';' ) )) as SUB_BUILD_NP_EST_MPAGE,
num(trim( TextBetween([EST_NON_PROD_BUILD_HRS], 'Rules:' , ';' ) )) as SUB_BUILD_NP_EST_RULES,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'CPOE:' , ';' ) )) as SUB_BUILD_NP_EST_CPOE,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'CCL:' , ';' ) )) as SUB_BUILD_NP_EST_CCL,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'Charges:' , ';' )) ) as SUB_BUILD_NP_EST_CHARGES,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'HIM:' , ';' ) )) as SUB_BUILD_NP_EST_HIM,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'Lab:' , ';' )) ) as SUB_BUILD_NP_EST_LAB,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'CMpage:' , ';' )) ) as SUB_BUILD_NP_EST_CMPAGE,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'Pharm:' , ';' ) )) as SUB_BUILD_NP_EST_PHARM,
num(trim( TextBetween([EST_NON_PROD_BUILD_HRS], 'ProvDoc:' , ';' )) ) as SUB_BUILD_NP_EST_PROVDOC,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'Rad:' , ';' )) ) as SUB_BUILD_NP_EST_RAD,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'Surgery:' , ';' )) ) as SUB_BUILD_NP_EST_SURGERY,
num(trim( TextBetween( [EST_NON_PROD_BUILD_HRS], 'Core:' , ';' )) ) as SUB_BUILD_NP_EST_CORE,

1 Solution

Accepted Solutions
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

So if it is missing at last position, you want to add it?

That’s how you can do that:

 

if( wildmatch(right([EST_NON_PROD_BUILD_HRS],1), ';'),[EST_NON_PROD_BUILD_HRS],[EST_NON_PROD_BUILD_HRS]&';') as DesiredResult,

...

 

View solution in original post

3 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi,

 

Try this:

if( wildmatch(right([EST_NON_PROD_BUILD_HRS],1), ';'),[EST_NON_PROD_BUILD_HRS],'Last char is not ;')as DesiredResult,

...

 

This will check if the last char is ; and give you the full field if it is. Otherwise it will populate 'Last char is not ;'

cbaqir
Specialist II
Specialist II
Author

Thanks but I need to concat the last character as a ';' if it's not there for the rest of the code to work.

Stoyan_Terziev
Partner - Creator III
Partner - Creator III

So if it is missing at last position, you want to add it?

That’s how you can do that:

 

if( wildmatch(right([EST_NON_PROD_BUILD_HRS],1), ';'),[EST_NON_PROD_BUILD_HRS],[EST_NON_PROD_BUILD_HRS]&';') as DesiredResult,

...