Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

How to get Distinct Year

Hello Everyone,

With below expression im not getting distinct year, how to avoid duplicate years while loading script

Any suggestion or modifications on below expression

=Date(Mid([MTRC_FCT_DT],1,8),'YYYY') as Year

Best Regards,

Niranjan

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

If you are getting year from Date field

=Year(YearStart(Date(Mid([MTRC_FCT_DT],1,8)))) as Year


Regards,

jagan.

View solution in original post

9 Replies
Chanty4u
MVP
MVP

load *

Distinct([MTRC_FCT_DT]) as  newyear

jagan
Partner - Champion III
Partner - Champion III

Hi,

If you are getting year from Date field

=Year(YearStart(Date(Mid([MTRC_FCT_DT],1,8)))) as Year


Regards,

jagan.

avinashelite

Try like this :

makedate(Mid([MTRC_FCT_DT],1,8)) as Year

senpradip007
Specialist III
Specialist III

Share your qvw, it would easy for us to help.

Anonymous
Not applicable

=Year(Yearstart(Year),1,4) as Year try this one

Digvijay_Singh

Use Year function to extract Year from Date.

tyagishaila
Specialist
Specialist

May be,

need group by

Share your .qvw to resolve it

Anonymous
Not applicable

What it is contain [MTRC_FCT_DT]??


Is this field contains Date only??

Anonymous
Not applicable

In list box to taken the distint values only