Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditionally finding the value in each fiscal year

Hello,

I am very vew to Qlik view.

I want to create a line chart which should show the total number of employees in each fiscal year.

The fiscal year starts from July-June. I have data from 2011-June to 2017-September.

Currently I have data from fiscal year 2011-2012, 2012-2013- 2013-2014, 2014-2015, 2015-2016, 2016-2017 and 2017-2018

2017-2018 is the currently running fiscal year.

II wrote an expression

=sum(

if(FiscalMonth=12,NumberEmployees)

)

it is giving me the correct number of employee count in all the fiscal year except 2017-2018 ( which started from July 2017)

My problem is the chart is not showing the max month of the currrent year value. it is showing upto 2016-2017

I have a field called FiscalYear and FiscalMonth in my datawarehouse

My logic is this:

If There is a fiscalMonth=12 ( June-which is the last month of our fiscal year) show the total number of employees in June

If the fiscal year is not completed , show the number of employees in the most current month (In this case Sepetember 2017)

Please help me to find the solution.

Thank you very much for your time and help

2 Replies
Anil_Babu_Samineni

How about this?

If(fiscalmonth=12 and fiscalmonth = Max(TOTAL fiscalmonth), Count({<fiscalmonth = {'$(=Min(fiscalmonth))'}>} employees), count({<fiscalmonth = {'$(=Month(Today()))'}>} employees))

OR

Sum(Aggr(If(fiscalmonth=12 and fiscalmonth = Max(TOTAL fiscalmonth), Count({<fiscalmonth = {'$(=Min(fiscalmonth))'}>} employees), count({<fiscalmonth = {'$(=Month(Today()))'}>} employees)), fiscalmonth, fiscalyear))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Thanks Anil for the reply.

Second function is not working and the first function is summing up all the values in each month.

Below is the number of employees in each month. I wanted to find the total number of employees in each fiscal year . For example, 2011-7 to 2012-6 is the fiscal year 2011-2012. The number of employees in each month varies as the employees resign from the company . The dimension is the FiscalYear. Would this explanation be helpful to find the solution

  

CYear-MonthNumber of Employees
2011-71535
2011-81533
2011-91544
2011-101565
2011-111579
2011-121584
2012-11592
2012-21601
2012-31582
2012-41612
2012-51630
2012-61627

  

2012-71640
2012-81652
2012-91678
2012-101671
2012-111694
2012-121679
2013-11692
2013-21708
2013-31706
2013-41699
2013-51761
2013-61764

Thank you very much for your help