Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression in script


Hi,

   can anybody  change the given expression and give me the same in scripting part.  but  want the count of  matched and unmatched rows...

EXP:::

IF(IsNull(TRIM(Company_NM))

,
If(UPPER(Trim([BU_SORT1]))<>UPPER(TRIM(LEFT([Common_NM],20))),'NO MATCH','MATCH')

   ,
If(UPPER(Trim([BU_SORT1]))<>UPPER(TRIM(LEFT([Company_NM],20))),'NO MATCH','MATCH')

)

i want this to code in script  but want to rename   as matched and unmatched   with sum

like     sum(if(BU_SORT1=Common_NM),1,0)  as matched 

sum(if(BU_SORT1<>Common_NM),1,0)  as unmatched

with the given conditions

I am trying but showing  error  as:  multiple parameters..

Pls help

 

6 Replies
jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

sum(if(BU_SORT1=Common_NM,1,0))  as matched ,

sum(if(BU_SORT1<>Common_NM,1,0))  as unmatched

Regards,

Jagan.

Not applicable
Author

Try like below:

Add the Flag to yuur scipt:

if( Len(Tirm(Company_NM) ,

if( upper(Trim(BU_SORT1)) = UPPER(LEFT(TRIM(Common_NM),20)) , 1 ,1 )

,0 ) AS MatchFlag

MatchFlag have 1 for match 2 for nomatch 0 for null

UI:

Counr({<MatchFlag={1}>} DISTINCTCompany_NM) --> Match Flag count

Counr({<MatchFlag={2}>} DISTINCTCompany_NM) --> NoMatch Flag count

Not applicable
Author

I want them to show in the table box ,so dont want to do anything in the  UI side.No falgs works out

Not applicable
Author

If you need the field shows on the table box, simply convert number into text.

if( Len(Tirm(Company_NM) ,

if( upper(Trim(BU_SORT1)) = UPPER(LEFT(TRIM(Common_NM),20)) , 'Match' ,'NoMatch' )

,null() ) AS IsMatch



Not applicable
Author

Dathu,  I didn't get you. can you clear me.

Not applicable
Author

can any body help pls