Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Percentage among two particular year / group of years

hi,

I have got 10 years of count employees data with Hiring Date.

Example: Year           :      2001     2002     2003     2004      .....     2010.

               Emp Count :      100       210       330      560                  2500

I need to find, increase or decrease in percentage of emp count between two particular years/ group of Years as

example:

2002 Vs 2004 or 2001 Vs 2006

Highest / lowest percentage between three given years as 2002 Vs 2004 Vs 2006.

Thanks.

1 Solution

Accepted Solutions
Digvijay_Singh

You may need to use input box to take input years and then text box to calculate the % change, as attached. Thanks,

View solution in original post

11 Replies
Chanty4u
MVP
MVP

sum([emp count])/sum(Total year)

Anonymous
Not applicable
Author

Take two variables, say:

Let VMaxyear= max(YearField);

Let VLastyear= max(YearField)-1;


Expression:  num((sum({<YearField={'$(=VMaxyear)'}>} EmpCount) - sum({<YearField={'$(=VLastyear)'}>} EmpCount))

/ sum({<YearField={'$(=VLastyear)'}>} EmpCount),'0.00%')

This will give you % increased or decreased based on your year selection


jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

Load * inline [

Year, Emp Count

2001, 100

2002, 210

2003, 330

2004, 560

2005, 2500

2006, 1000

2007, 700

2008,900

2009,1200

2010, 1500

];

Chart: Straight Table

Dimension: Year

Expression: =(Sum([Emp Count]) - Above(Sum([Emp Count])))/Above(Sum([Emp Count]))

Hope this helps you.

Regards,

Jagan.

Anonymous
Not applicable
Author

thanks for your reply.

This expression only gives max of YearField and max of YearField -1 (i.e.,) 2004 with 2005 or 2006 with 2007

What if i want to compare 2005 with 2010 or 2001 with 2004.

how do i get percentage increase or decrease between any two particular year i select

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Current Month:

Sum({<Year={$(=Max(Year))}, Quarter=, Month=, Week=, Date=>} Sales)


Previous Month:

Sum({<Year={$(=Max(Year, 2))}, Quarter=, Month=, Week=, Date=>} Sales)


Note: Quarter=, Month=, Week=, Date= will ignore the selections in this fields, if there is no such fields then remove it.


Regards,

jagan.



Not applicable
Author

Hi Kishore, this should give you the:

"I need to find, increase or decrease in percentage of emp count between two particular years/ group of Years as

example:

2002 Vs 2004 or 2001 Vs 2006"

As for the High / Low, I'll try to add something to this app and get back with you ASAP.

I hope this helps!

Anonymous
Not applicable
Author

If you are looking for Comparison, I would suggest go for Alternate States..

Check this?

http://www.learnqlickview.com/alternate-states-in-qlikview/

Introduction to alternate states - The Qlik Fix! The Qlik Fix!

What all we have suggested, with these expression you can see Current V/s Previous or else you can hard code as well..

But for comparison, Alternate State is the best option

Digvijay_Singh

You may need to use input box to take input years and then text box to calculate the % change, as attached. Thanks,

Anonymous
Not applicable
Author

Thanks for your alternative idea. its working fine.