Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count month

Hello all

     I want to count number of months in current financial year as well as in previous year (though its fixed number 12),how do i do that??

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi Rohit,

Try like this

For Current Year :

Count({<MonthDimensionName=, YearDimensionName={$(=Max(YearDimensionName))}>} DISTINCT MonthDimensionName)

For PreviousYear :

Count({<MonthDimensionName=,YearDimensionName={$(=Max(YearDimensionName)-1)}>} DISTINCT MonthDimensionName)

Regards,

Jagan.

View solution in original post

5 Replies
amit_saini
Master III
Master III

Rohit,

Follow this:

Count of month

Thanks,
AS

Not applicable
Author

Hi,

You can use 'set analysis' or 'If' condition to get the result.

Example: If Condition ;

For Current Year : Count(if(Year_col=Year(Today()),Month_col))

For PreviousYear : Count(if(Year_col=Year(Today())-1,Month_col))

Regards.

SunilChauhan
Champion
Champion

count( {<FinYear={">=$(=max(FinYear)-1)"}>} distinct Monthfield)  for if you want combined

else

For Current Year : Count({<FinYear={$(=Max(Finyear))}>} Monthfield)

For PreviousYear :Count({<FinYear={$(=Max(Finyear)-1)}>} Monthfield)

you can calculate financial Year

MonthName(yearfield,0,4)

hope this helps

Sunil Chauhan
jagan
Luminary Alumni
Luminary Alumni

Hi Rohit,

Try like this

For Current Year :

Count({<MonthDimensionName=, YearDimensionName={$(=Max(YearDimensionName))}>} DISTINCT MonthDimensionName)

For PreviousYear :

Count({<MonthDimensionName=,YearDimensionName={$(=Max(YearDimensionName)-1)}>} DISTINCT MonthDimensionName)

Regards,

Jagan.

Not applicable
Author

Thank you jagan