4 Replies Latest reply: Mar 2, 2016 5:29 AM by L Nibbelink

# 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?

• ###### Re: Add months to salary

Where are the salaries per month for the employees?

• ###### Re: Add months to salary

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

• ###### Re: Add months to salary

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?

• ###### Re: Add months to salary

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())