Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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??

Labels (1)
1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

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 II
Champion II

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
Partner - Champion III
Partner - Champion III

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