Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Format & Merging Columns

Hi

  1. How do i change a date format from say, Jan 2012 to Jan-12
  2. How do i merge columns.  I have the table below with each column showing Forecast, however i want to have a main heading called "Forecast" and the months below. 
    Forecast - Jan 2012Forecast - Feb 2012Forecast - March 2012

kind regards

Nayan

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

These are the expressions you need

='Forecast Sales Qty  ' & Date(addmonths(max([Trans Date]), 1), 'MMM-YY')

='Forecast Sales Qty  ' & Date(addmonths(max([Trans Date]), 2), 'MMM-YY')

='Forecast Sales Qty  ' & Date(addmonths(max([Trans Date]), 3), 'MMM-YY')

Regards

Jonathan

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

View solution in original post

6 Replies
thomas_skariah
Creator III
Creator III

Hi Nayan,

You can try the following code.

='Forecast-' & Date#(date(YourDateField,'MMM-YY'))

Regards,

Tom

Not applicable
Author

Hi Thomas

Thank you for your feedback. . I've used your formula, but it did not work.  Im new at Qlikview, and below the table is the scripting for the columns that was created for us. 

Forecast Sales Qty  Oct-2012Forecast Sales Qty  Nov-2012Forecast Sales Qty  Dec-2012

='Forecast Sales Qty  ' & month(addmonths(max([Trans Date]) ,1)) & '-' & year(addmonths(max([Trans Date]) ,1))

='Forecast Sales Qty  ' & month(addmonths(max([Trans Date]) ,2)) & '-' & year(addmonths(max([Trans Date]) ,2))

='Forecast Sales Qty  ' & month(addmonths(max([Trans Date]) ,3)) & '-' & year(addmonths(max([Trans Date]) ,3))

kind regards

Nayan

thomas_skariah
Creator III
Creator III

Hi Nayan,

You can try this one

='Forecast Sales Qty  ' & month(addmonths(max([Trans Date]) ,1)) & '-' &date(date#(max(Year([Trans Date])), 'YYYY'),'YY').

Regards,

Tom

Not applicable
Author

Hi Tom

Apologies for the dealyed reply.  The result is as follows where there year has fallen away:

Forecast Sales Qty  Oct-
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

These are the expressions you need

='Forecast Sales Qty  ' & Date(addmonths(max([Trans Date]), 1), 'MMM-YY')

='Forecast Sales Qty  ' & Date(addmonths(max([Trans Date]), 2), 'MMM-YY')

='Forecast Sales Qty  ' & Date(addmonths(max([Trans Date]), 3), 'MMM-YY')

Regards

Jonathan

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

Hi Jonathan

Thank you for you help.  It worked.  On my 2nd query on how to merge columns, is there a way this can be done?

kind regards

Nayan