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

count of active months

Hi,

With below expression, we are able to get sum of value which we have in 18months. How can we get count of the months


Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -24)) & '<=' & Date(AddMonths(Max(Date), -6)))"}>}Value)


For example, i will be having data as 100 in last 12 months, this does not mean as in all last 12 months i have data.

how can i get months and count of months in which i have data.


Can anyone please suggest on this

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

NO, on the app I send to you above, the expression used is this one :

=Count({<data1={"=len(trim(data1))<>0"}>}date)

View solution in original post

24 Replies
YoussefBelloum
Champion
Champion

Hi,

add this on your set analysis:

Value={"=len(trim(Value))<>0"}

Anonymous
Not applicable
Author

this is to get value  greater than zero right, how i can get months related to greater than zero value as my request

For example, i will be having data as 100 in last 12 months, this does not mean as in all last 12 months i have data.

how can i get months and count of months in which i have data.


Can anyone please suggest on this

krishna_2644
Specialist III
Specialist III

in set expression ,try something like this:

months =" $(= p( Value={"=len(trim(Value))<>0"}) months )"

YoussefBelloum
Champion
Champion

the solution I gave you is when you don't have data at all on a month with the measure Value (using month as dimension).

like this, as u said, it will not count the "non active" months.

did you try it ?

agigliotti
Partner - Champion
Partner - Champion

maybe this:

Count( {< Date = {"$(='>=' & Date(AddMonths(Max(Date), -24)) & '<=' & Date(AddMonths(Max(Date), -6)))"} >} Distinct your_month_field )

Anonymous
Not applicable
Author

i tried using this, but no luck.


i am using correctly as you mentioned

Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -24)) & '<=' & Date(AddMonths(Max(Date), -6)))"}>}{"=len(trim(Value))<>0"})

Anonymous
Not applicable
Author

i tried using this, but no luck.


am i using correctly as you mentioned

Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -24)) & '<=' & Date(AddMonths(Max(Date), -6)))"}>}{"=len(trim(Value))<>0"})

agigliotti
Partner - Champion
Partner - Champion

please add the below in set analysis:

your_month_field = {"=Sum(Value)>0"}

YoussefBelloum
Champion
Champion

it is not correctly written..

try like this:

Sum({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -24)) & '<=' & Date(AddMonths(Max(Date), -6)))"},Value={"=len(trim(Value))<>0"}>} Value)