Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sdepotter
Contributor
Contributor

merge 2 dimensions on X-axes in bar chart

Hi,

we have one Excel data file in which we have the personnel number, the startdate of employees and in another column the enddate of employees. we now use a calendar script to extract Year from both columns (i.e. startyear from the startdate field  and endyear from the enddate field).

Now we try to create a bar chart with "Year" on the X-axes. problem is that we have to choose either the year from the startdate or from the enddate. is there a way to combine this and just show year with per year two lines (one for the number of employees that started and one for the number that has left).

hope this is possible?

thx

Sam

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

This will show how to load and use such data:

Canonical Date

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sdepotter
Contributor
Contributor
Author

Hi Jonathan,

I have followed your recommendation and tried below script. However, I get this error:

  Script line error:

  CALL CalendarFromField('Date', 'CommonCalendar', '')

Can't figure out what I'm doing wrong. Is it because the two date fields come out of one and the same datafile?

DateLink:

LOAD

    [Empl Nr],

    StartBarco as Date,

    'Start' as DateType

RESIDENT SAP_Personnel;

LOAD

    [Empl Nr],

    EndBarco as Date,

    'End' as DateType

RESIDENT SAP_Personnel;

CALL CalendarFromField('Date', 'CommonCalendar', '');

much appreciated

Sam

jonathandienst
Partner - Champion III
Partner - Champion III

Did you define the sub CalendarFromField or include the code that defines the sub?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sdepotter
Contributor
Contributor
Author

My apologies, don't believe I have. Can I find somewhere how to do this?

thanks

Sam