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: 
sujata
Contributor
Contributor

Sum and if condition

How to calculate 

OS days - 30

Credit Period  - 30

Amount - 400

 

How to calculate, if OS days  is greater than Credit than Sum of amount else 0

Labels (1)
5 Replies
rubenmarin

Hi, one simple way can be Sum(If([OS days]>[Credit Period], Amount)).

sujata
Contributor
Contributor
Author

Thanks ,

 

Amount I calculate using below expression. How to add this in above formula can you help

Sum({$<class =-{'xxx'}, class=-{'yyy'}>}[amount]/10^6)

BrunPierre
Partner - Master
Partner - Master

Maybe this

If([OS days]>[Credit Period],Sum({$<class =-{'xxx','yyy'}>}[amount]/10^6) )

or

Sum({$<class =-{'xxx','yyy'},[Unique Field]= {"=([OS days]>=[Credit Period])" }>}[amount]/10^6)

sujata
Contributor
Contributor
Author

If([OS days]>[Credit Period],Sum({$<class =-{'xxx','yyy'}>}[amount]/10^6) ) 

Its not working 

 

if([No of Outstanding Days]<=[Final credit period as per MSA],Sum({$<class =-{'xxx'}, class=-{'yyy'}>}[amount]/10^6))

rubenmarin

Hi, you can try with:

Sum({$<class =-{'xxx'}, class=-{'yyy'}>} If([OS days]>[Credit Period], Amount/10^6))