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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation of population based on previous months

Hi Al,

There is a problem which I am not able to sort out.

I have to calculate population of any organisation based on different dimensions...

Example is attached herewith:

For example I am explaining the data...

There are region, dept, branch office as main dimensions....

there is joining date , resigning date and transition date...

If a person joins the company then joining date is entered and the respectivve transition date and column count is updated as 1.

I he resigns then resign date is insertd and the transition ate will be the resign date and cnt is updated as -1.

I have calculated the cummulative value.

But I am unable to calculate population in charts, as in data  year2012 on sep 30 there were 309, people and in oct there were only308, but my chart calculates it wrong.

Please suggest..

21 Replies
Not applicable
Author

Hello John Sir,

Thank you very much for showing interest and sparing your valuable time for the issue.

I am sorry my actual requirment was little bit different.

In my original post I had attached a qvd file in which there is tran_dt(date field) and a cnt field representing either a employee has joined or resigned by 1 and -1 respectively.

So I need an expression to calculate population fo the company which could be the sum(cnt) for all tran_dt <= the seleted year/month/date.

Now I am using the expression "sum({$<tran_dt={">=$(=vMin_dt)<=$(=vMax_dt)"}>}cnt)" where I have fixed the minimum date and dynamically calculating the max date.

When there is no selection then chart values are correct for year but when I select particular year and drills to month the values are totally wrong , as qlikview cannot recognize data for previous dates .

Please help me out.....

Not applicable
Author

Please share the QVW if you got the solution of your problem..

I have the near about same requirement .

If it is possible please share the qvw.