Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Discription

Hi,

I have transformt a date value into a year value in Qlik Sense -> year(floor(date.value)) in a listbox. Now, when I click on the year value in the listbox, Qlik Sense give me back the selected value with year(floor(date.value)). Is there a possibilty to make this Year? Outside the script directly into the front end?

Thank you...

3 Replies
MK_QSL
MVP
MVP

Create Year in Script...

Load

     date.value,

     Year(date.value) as Year

From Table...

Or use

Year(date.value) as list box (using expression)

sunny_talwar

As Manish's sample show you won't need Floor() function here. Floor is needed when converting from TimeStamp Field to Date Field. For extracting just Year (or month or day) you would just need to wrap is around with Year() (or Month() or Day()) functions.

the only thing to make sure is that QV reads your date as true date (and not as a string). If for some reason it isn't read as a date you can use Date#() function to help it understand that it is actually a date. (Why don’t my dates work?)

reddy-s
Master II
Master II

Hi Hans,

Make use of the year(date) function to create a year field. There are umpteen number of date functions which would be of great help in Qlik check this document for more information:

Creating A Master Calendar

Thanks,

Sangram