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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlik__Vinodh
Partner - Creator II
Partner - Creator II

Max count comparison on year /previous year

Dear all,

I am having one problem,that is

1. I am having 5 years data now,if i click a year in dashboard, i need current year max employee count Month data and previous year max employee count month data in bar chart .

2. dimension is month, and Expression is  Count(distint Emp_Id).

3. any one having sample application for same soluation ,share me.

if any one knows the soluation.pls help me.

Thanks,

c vr

13 Replies
Qlik__Vinodh
Partner - Creator II
Partner - Creator II
Author

Hi ,

If any one knows soluation pls help me

Qlik__Vinodh
Partner - Creator II
Partner - Creator II
Author

Hi ,

If any one knows soluation pls help me

Not applicable

Hi,

You can try the following steps to get this done:

To begin with, define three variables

1. vSelectedYear

Definition: =GetCurrentField(Year)

2. vPreviousYear

Definition: = (GetCurrentField(Year)-1)

:

3. vMaxx_Month

Definition: =MaxString({<Year={$(vSelectedYear)}>}Month)

Now, create a bar chart and add the following expressions:

1. For Selected Year:

=count({<Year={$(vSelectedYear)},Month={$(vMaxx_Month)}>}EmployeeID)

2. For Previous Year:

=count({<Year={$(vPreviousYear)},Month={$(vMaxx_Month)}>}EmployeeID)

Please find sample attached.

Hope it helps

Regards,

-Khaled.

Qlik__Vinodh
Partner - Creator II
Partner - Creator II
Author

Hi Khaled,

Thanks for your reply.u r showing the always selecting the Max month in current year and previous year.it is ok.but  i need the selected year highest count month and previous year highest count month comparison .

The value of count should be High value in current year and previous year. if have any soluation help me.

Thanks&Regards,

c vr