# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor

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

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
Esteemed Contributor

## Re: count of  active months

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

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

24 Replies
Esteemed Contributor

## Re: count of active months

Hi,

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

Contributor

## Re: count of active months

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

Valued Contributor III

## Re: count of active months

in set expression ,try something like this:

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

Esteemed Contributor

## Re: count of  active months

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 ?

Honored Contributor II

## Re: count of active months

maybe this:

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

Contributor

## Re: count of  active months

i tried using this, but no luck.

i am using correctly as you mentioned

Contributor

## Re: count of  active months

i tried using this, but no luck.

am i using correctly as you mentioned

Honored Contributor II