4 Replies Latest reply on Nov 22, 2016 5:23 AM by Andrew Watson

# How to get the no of profitable days in a month?

I want to create a view to show the no of profitable days in each month of the year. I have a calculated field to get the profit per day . {  Fixed [Order Date] : Sum([Profit]) }. As per my understanding this will return me the profit for the lowest level detail of order date which is day. Now if [profit per day] > 0 , then its a profitable day, else it is an unprofitable day. Now I want to get a count of all these profitable days in each month. How can I do this please help. i have used the superstores data.

• ###### 1. Re: How to get the no of profitable days in a month?

Hi Simi

Please provide some Workbook so that we can work upon it and get back to you in a better way.

Rahul

• ###### 2. Re: How to get the no of profitable days in a month?

set up an if then else using 1 and 0. You can modify the fixed calc to be

IF {  Fixed [Order Date] : Sum([Profit]) } > 0  THEN 1 ELSE 0 END. (call this [FixedProfitPerDayFLG])  where this {  Fixed [Order Date] : Sum([Profit]) } would just be [FixedProfitPerDay]

Or you can continue going down the new calc path feeding in the fixed calc

IF [FixedProfitPerDay] > 0 THEN 1 ELSE 0 END (call this [FixedProfitPerDayFLG])

Then you just sum up whatever calc you use. SUM([FixedProfitPerDayFLG])

• ###### 3. Re: How to get the no of profitable days in a month?

This formula should do it: { FIXED [Order Date]: IF SUM([Profit]) > 0 THEN 1 END }

Sum that field to get a count of all profitable days.

1 of 1 people found this helpful
• ###### 4. Re: How to get the no of profitable days in a month?

John got in there fast - the solution is very similar to mine