Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add months to salary

Hi,

I'm new to Qlik and trying to acomplish the following.

I have a table with employees and year salary's. I also have a master calendar and some other tables.

This is my master calendar

minmax:

LOAD

   date(max(OrderDate)) as MaxDate

RESIDENT Facttable;

LET vMinDate = Num(makedate($(vDateLimit)));

LET vMaxDate = Num(peek('MaxDate'));

DROP TABLE minmax;

TempCalendar:

LOAD

date($(vMinDate) + rowno() -1) as TempDate

AutoGenerate

$(vMaxDate) - $(vMinDate) + 1;

MasterCalendar:

Load

TempDate As OrderDate,

'Q-' & Ceil(Month(TempDate)/3) as Quarter,

Week(TempDate) As Week,

Year(TempDate) As Year,

Month(TempDate) As Month

resident TempCalendar;

This is my Employees table

Employees:

LOAD EmployeeID,

  FullName,

  [Year Salary]

RESIDENT EmployeesTmp;

I want to make a new calendar, with the employeeID's, Salary's per month and with them linking to the OrderDate of the mastercalendar. How do i accomplish this?

Thanks in advance.

4 Replies
Gysbert_Wassenaar

Where are the salaries per month for the employees?


talk is cheap, supply exceeds demand
Not applicable
Author

They do not exist yet. I only have a year salary in my source.

Gysbert_Wassenaar

Then you have to decide how to turn the year salary into month salaries. And which year are we talking about. I didn't see a year field either. Or does the year salary apply to all years for the entire time span in the master calendar?


talk is cheap, supply exceeds demand
Not applicable
Author

Hi There,

I've found a solution:)

It indeed had to go the full span of the master calendar. So first i created a temp table where with iterno() i've generated the 12 months, and after that in the defenitive table the years (also with iterno())