Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to remove negative and null values from expression

Dear Tamil,

Here is the sample file,

Dear Experts,

COLL_CODELOAN_NONAMEAREASLOANNO_OF_INS
CHEQUERL0068A.M.C.L.ATTANAYAKE03000000
CL001RL0013D.A.DAGLAS2250010000018
RL0035K.LIYANARACHCHI100002000040
RL0044P.D.GAMAGE224002000009
RL0050M.A.K.I.FERNANDO2975015000015
RL0051D.M.R.S.THENNAKOON135002000005
RL0054R.G.PREMACHANDRA25002000001
RL0067A.M.R.BANDARA325250001
RL0069K.P.ARIYASENA0500000
RL0071S.A.U.PALITHA20300000
RL0073J.M.DUSHANTHA0500000
RL0074E.G.D.M.K.PRADEEP-47525000-1
RL0075T.G.A.LASANTHIKA01000000
RL0076K.U.SARANAPALA25002000001
RL0077G.V.C.JAYATHILAKA-35050000-1
RL0078N.M.P.NAWARATHNE-35050000-1
RL0082D.M.R.S.THENNAKOON3900700004
RL0089L.S.GAJANAYAKA-675150000-0
RL0092J.C.KUMARI01000000
RL0093K.R.SILVA-250150000-0
RL0100V.SHIVAKUMAR0250000
Total105295
CL002RL0081A.R.THILAKARATHNE01000000
RL0085N.SIVARAJAH575500001
RL0086M.KALEIRAJAH390300001
RL0090D.R.T.SABRIN-150060000-2
RL0095S.H.M.SHAKEER-7525000-0
RL0099J.M.C.P.K.JAYATHILAKA01000000
RL0101R.M.SARATH190150001
Total-420


My pivot table shown above.

AREA = SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT))))

LOAN = IF(STATUS='ACTIVE', LOAN_AMOUNT)

NO_OF_INS = RANGESUM(AREAS)/INS_AMT

I want to remove the negative and null values from the resulted table. so How can I modify my expressions to do the same?

Thanks in Advance.

Priyantha.

28 Replies
sunny_talwar

Using Avinash's expressions, I got this

Capture.PNG

1)

Sum(Aggr(if(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT))))>0,SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))),null()), COLL_CODE, LOAN_NO, NAME))

2)

Sum(Aggr(if(IF(STATUS='ACTIVE', LOAN_AMOUNT)>0,IF(STATUS='ACTIVE', LOAN_AMOUNT),null()), COLL_CODE, LOAN_NO, NAME))

3)

Sum(Aggr(if(RANGESUM(AREAS)/INS_AMT>0,RANGESUM(AREAS)/INS_AMT,null()), COLL_CODE, LOAN_NO, NAME))

or

3)

Sum(Aggr(if(RANGESUM(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))))/INS_AMT>0,RANGESUM(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))))/INS_AMT,null()), COLL_CODE, LOAN_NO, NAME))


Capture.PNG

Anil_Babu_Samineni

Sunny, If possible, can you please share me that Workfile. So that, she can try that file...

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
Not applicable
Author

Grate  !!!

Sunny,

I have tried your proposal (aggr), but in that case subtotals and grand total getting correct solutions. So still null values are spearing on the "AREAS" column and "NO_OF_INS"column.

Thanks lot for the big help.

Priyantha.

Anonymous
Not applicable
Author

to give the out put

if(ALT((RANGESUM(AREAS)/INS_AMT)*-1, 0)<=0,'',ALT((RANGESUM(AREAS)/INS_AMT)*-1, 0))

sunny_talwar

May be share a screenshot of what you are seeing and highlight the part you would not want to see (using the new expressions I provided)

Not applicable
Author

Untitled.jpg

sunny_talwar

Here try these now:

1)

Sum(Aggr(

if(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))) > 0 and

IF(STATUS='ACTIVE', LOAN_AMOUNT) > 0 and

RANGESUM(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))))/INS_AMT > 0,

SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))),null()), COLL_CODE, LOAN_NO, NAME))

2)

Sum(Aggr(if(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))) > 0 and

IF(STATUS='ACTIVE', LOAN_AMOUNT) > 0 and

RANGESUM(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))))/INS_AMT > 0,

IF(STATUS='ACTIVE', LOAN_AMOUNT),null()), COLL_CODE, LOAN_NO, NAME))

3)

Sum(Aggr(if(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))) > 0 and

IF(STATUS='ACTIVE', LOAN_AMOUNT) > 0 and

RANGESUM(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))))/INS_AMT > 0,

RANGESUM(SUM(IF(STATUS='ACTIVE', IF(FLAG='A'OR FLAG='R',(RECIEVABLE-RECEIPT_AMT)))))/INS_AMT,null()), COLL_CODE, LOAN_NO, NAME))

Not applicable
Author

Dear Sunny,

It's grate work, my problem totally solved,

Thanks you once again.........!!!

Priyantha

sunny_talwar

Awesome