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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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 II
Partner - Master II

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
MVP
MVP

Hi, you can try with:

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