Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have these fields in my database, PayRollYear and PayRollMonth and EMPNO.
I want to create a combo chart, that shows the count of employees in the present year vs the previous year. Present year would be a bar chart, and previous year would be a line chart, month being the dimension. Any ideas????
Create 2 expressions for the count:
sum({<PayRollYear = {'2015'}>}EMPNO)
sum({<PayRollYear = {'2014'}>}EMPNO)
add month to the bar and set the 2 expressions as desired to line or bar.
also consider to use max(year) and max(year)-1 to make the year dependent on your year selection
This works fine, but if I use, year and year-1, it does not work. Gives the same value for both. MichielvandeGoor
Hi,
Try to use with Max and Max - 1
For Current Year
sum({<PayRollYear = {'$(Max(PayRollYear))'}>}EMPNO)
For Previous Year
sum({<PayRollYear = {'$(Max(PayRollYear)-1)'}>}EMPNO)
Or
sum({<PayRollYear = {'$(Year(Date(Max(PayRollYear)-1)))'}>}EMPNO)
Regards
Anand
Hi,
Create a graph with dimension Month and two expressions:
First expression in bar chart:
count(distinct {<PayRollYear ={$(=Max(PayRollYear))}>}EMPNO)
Second expression in line chart:
count(distinct {<PayRollYear ={$(=(Max(PayRollYear)-1))}>}EMPNO)
You need to eliminate the year selection if you use set analysis> Just add year = to your set analysis
sum({<PayRollYear = "$(=Max(PayRollYear ))"}, PayRollYear =>}EMPNO)
sum({<PayRollYear = = {"$(=Max(PayRollYear ) -1)"}, PayRollYear =>}EMPNO)
Thanks a lot! Much appreciated.
Thanks a ton! It works!
Please give points to express your thanks ![]()
that's great 🙂
please mark the discussion as solved if the question is solved for you