Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Order by Year

Hi! I've got a table where a column contain a list of date for example "20/02/1964". I want to obtain a new column where i can see only the year for each date. What kind of string i have to type to obtain this result??

Tags (1)
4 Replies
hrlinder
Not applicable

Re: Order by Year

use date functions like

year(yourdate)

maybe you have to convert your date if Qlikview doesnot recognize it as data, the use date(date#(yourdate,'DD/MM/YYYY')

qlikviewsam
Not applicable

Re: Order by Year

Hi,

year function will help you..

example

table a:

load

name,

age,

date,

year(date) as year

from

datasource order by year(date) ;

i hope this will help u..

maleksafa
Not applicable

Re: Order by Year

you can add it in the script when loading the data using the Year function, year(data field) or use a calculated dimension in the chart and add the function there Year(data field), however it is not preferred to use calculated dimension instead add it in the load script.

martinpedersen
Not applicable

Re: Order by Year

Hi Gabrielle,

Are you working in the Load script og in a chart?

In Load Script:

If in the Load-script, something like this will do the trick:

Data:

Load Date, Year(Date) as Year, * From Data.Qvd (qvd);

In Charts:

If your are working in a chart you can add a calculated dimension with the expression Year(Date) :

5.PNG.png