Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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??

4 Replies
Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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
Specialist
Specialist

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
Creator
Creator

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