5 Replies Latest reply: Sep 19, 2012 12:22 PM by whiteline _

# Column in IF

Good day

It is necessary to calculate the number of days when the stock was higher than the average sales

Average Sales are in the first column

Count (Distinct if (stock> Column (1), Date)) does not work

Hi.

• ###### Re: Column in IF

Dimensions: goods

Average Sales:

Sum({<Date={">=\$(=

Date(If(

IsNull(

FirstSortedValue({<Count={">0"},Satus={"1"},Check={"1"}>}   Date, -Date, 20)),

Min({<Count={">0"},Ststus={"1"},Check={"1"}>}Date),

FirstSortedValue({<Count={">0"},Status={"1"},Check={"1"}>}  Date, -Date, 20))

))"},Count={">0"},Status={"1"},Check={"1"}>} Count

)

/If(

IsNull(

FirstSortedValue({<Count={">0"},Status={"1"},Check={"1"}>} Date, -Date, 20)),

Count({<Date={">=\$(=Min({\$<Count={">0"},Status={"1"},Check={"1"}>}Date))"},Count={">0"},Status={"1"},Check={"1"}>}distinct Date ),20)

• ###### Re: Column in IF

the number of days when the stock was higher than the average sales

You could use aggr() to check it for all Dates (and keep goods dimension):

=Count (aggr(if(stock>Column (1), Date, null()), Date, goods))

• ###### Re: Column in IF

does not work

• ###### Re: Column in IF

Could you post a sample ?