Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add IF null statement to current expression

I am currently counting First discovered dates, how would i add

"count first discovered within the last month IF Closed_mitigated_On is null'

Open:

Count({$<First_Discovered={'>=$(=MonthStart(Today()))<=$(=Today())'}> } First_Discovered)

Also, I am looking to add a compliance flag into this this chart. How would I write Count(compliance_flag for the last month)

the above count statement isn't working.

13 Replies
Gysbert_Wassenaar

Not sure what you want. Perhaps this:

Count({$<First_Discovered={'>=$(=MonthStart(Today()))<=$(=Today())'}, Closed_mitigated_On-={'*'} >} First_Discovered)


talk is cheap, supply exceeds demand
Anil_Babu_Samineni

"count first discovered within the last month IF Closed_mitigated_On is null'

For this, You can use like below


If(IsNull(Closed_mitigated_On), Count({<Month = {'$(=Max(Month, -1))'}>}[first discovered]))

Or

If(IsNull(Closed_mitigated_On), Count({<Month = {'$(=AddMonths(Max(Month),-1))'}>}[first discovered]))

Also, I am looking to add a compliance flag into this this chart. How would I write Count(compliance_flag for the last month)

the above count statement isn't working.

For this, you can write like below

Count({<Month = {'$(=Max(Month, -1))'}>}compliance_flag)

Or

Count({<Month = {'$(=AddMonths(Max(Month),-1))'}>}compliance_flag)

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

None of these worked

Anil_Babu_Samineni

Would you explain more please

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

the 'month' isn't working and it isn't returning any data.

Count({<Month = {'$(=AddMonths(Max(Month),-1))'}>}compliance_flag



Anil_Babu_Samineni

May be you don;t have month field. Use same month field if you have and then count of that

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

it still says "expression Ok" but doesn't return any values.

the compliance flag has "compliant" and "non compliant'. so the current expressions for my chart are "Open", "closed" and I want two more that are "compliant" and "non Compliant" that show data from the last month.

Anil_Babu_Samineni

Is there any chance to share application?

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
vinieme12
Champion III
Champion III

Try


Count({$<First_Discovered={'>=$(=MonthStart(Today()))<=$(=Today())'}, Closed_mitigated_On ={"=len(Closed_mitigated_On )=0"} >} First_Discovered)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.