Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if no employees joined in current Month take till previous month employee count

hi Guru's

i have Data like this

   St_Date, Employees

    01-Jan-2015, 1000

    01-Feb-2015, 2000

    01-Mar-2015, 3000

    01-Apr-2015, 4000

    01-Jul-2015, 5000

i dont have data for May,June

But i want to show 4000 for May . and 4000 for June

     01-Jan-2015, 1000

    01-Feb-2015, 2000

    01-Mar-2015, 3000

    01-Apr-2015, 4000

    01-May-2015, 4000

     01-Jun-2015, 4000

    01-Jul-2015, 5000

Means,in May 2015,Jun 2015 no employees joined,

In May 2015 no employees joined in organization ,so need to take till April employee count for April

same for June also

Thanks in advance

please find the sample application

2 Replies
sunny_talwar

Script:

Table:

LOAD Date#(St_Date, 'DD-MMM-YYYY') as St_Date,

  Employees

Inline [

St_Date, Employees

01-Jan-2015, 1000

01-Feb-2015, 2000

01-Mar-2015, 3000

01-Apr-2015, 4000

01-Jul-2015, 5000

];

Date:

LOAD Date#(St_Date, 'DD-MMM-YYYY') as St_Date

Inline [

St_Date

01-Jan-2015

01-Feb-2015

01-Mar-2015

01-Apr-2015

01-May-2015

01-Jun-2015

01-Jul-2015

];

Expression:

=If(IsNull(Employees),

If(IsNull(Above(Employees)), Above(Sum(Employees), 2, 0), Above(Sum(Employees))),

Sum(Employees))

The expression need to be updated if you can have more than 2 months without data.

Output:

Capture.PNG

I did not have a licensed version of QV, so instead of using your attached qvw, I created a new one. So won't know if you have different data in your qvw.

HTH

Best,

Sunny

Anonymous
Not applicable
Author

Hi Thanks for your Time,

Its helpful Answer.

But my actual Data is more no of Columns,i cant create Join Table Manually.

Please Propose solution To my actual data set

For my actual data set

Dimension:Month Name,Manager Name

Expression:Count(worker)

Issue:If i select Year 2015,Iam Missing Data for July 2015

Please find the sample Screen shot

Note :if you load 2 excel source file ,they automatically join with hiring manager

Please find my actual data sets

Thanks In-advance