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: 
Chanty4u
MVP
MVP

RE:Date error

hi all,

What wrng in my expression

my date field as

date

2014-may-05

2014-may-06

2014-may-07

2014-may-08

2014-may-09

2014-may-10

=date(MonthsStart( "date"), 'YYYY-MMM')

i want to display date as   :2014-may

how can i get this date.

13 Replies
marcus_sommer

The manually written date was only to show that the logic and syntax is right - you could it replace directly with your date-field. If you get then no valid result it meant that your date-field contained a different value and/or format then you expect. Maybe it needs then a trim() or it is really a timestamp instead a date and the expressions needs to be adjusted a little bit.

- Marcus

maxgro
MVP
MVP

the same expression can work in a chart

you can do a straight table chart with (this is just an example) a

- calculated dimension          date(MonthStart(date#(datefield, 'YYYY-MMM-DD')), 'YYYY-MMM') as newdatefield

- expression                             count(datefield)

1.png

this is the script for the example above

Source:

load * inline [

datefield

2014-may-05

2014-may-06

2014-may-07

2014-may-08

2014-may-09

2014-may-10

2015-may-10

];

Chanty4u
MVP
MVP
Author

Thnx M G and Marcus.      your info is awesome. grt explnatn.  .

Chanty4u
MVP
MVP
Author

hi,

It is not working alrdy tried dat one.

Thanks

Suresh