Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: Add months to salary

Where are the salaries per month for the employees?


talk is cheap, supply exceeds demand
Not applicable

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?


talk is cheap, supply exceeds demand
Not applicable

Re: Add months to salary

Hi There,

I've found a solutionSmiley Happy

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

Community Browser