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.

1 Solution

Accepted Solutions
marcus_sommer

You tried it with MonthsStart which requirred more than one parameter and therefore throws an error but you need instead MonthStart - to compare:

MonthsStart

MonthStart

Details to their differences could you find within the help.

- Marcus

View solution in original post

13 Replies
marcus_sommer

Try:

=date(MonthStart(date#(date, 'YYYY-MMM-DD')), 'YYYY-MMM')

- Marcus

Chanty4u
MVP
MVP
Author

thnx marcus,

Its shwng error in expression

PFAerror-date.png

marcus_sommer

You tried it with MonthsStart which requirred more than one parameter and therefore throws an error but you need instead MonthStart - to compare:

MonthsStart

MonthStart

Details to their differences could you find within the help.

- Marcus

Chanty4u
MVP
MVP
Author

thnx marcus.....even though it is nt gvng any value.. as expression is ok .  MonthStart  i used dis

marcus_sommer

I have tried this within a textbox and it's working fine:

=date(MonthStart(date#('2014-may-10', 'YYYY-MMM-DD')), 'YYYY-MMM')

- Marcus

Not applicable

Hi Suresh,

Can you use the below command in the expression.

=Date(Date#(date,'YYYY-MMM-DD'),'YYYY-MMM')

Thanks,

Sreeman

Chanty4u
MVP
MVP
Author

yeah.. its gvng  correct now but....we are gvng the date manually ryt.......if my data chnges?  how can i ?

maxgro
MVP
MVP

replace with the '2014-may-10' with the field name, in the code below datefield

Source:

load * inline [

datefield

2014-may-05

2014-may-06

2014-may-07

2014-may-08

2014-may-09

2014-may-10

];

load

  datefield,

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

Resident Source;

Chanty4u
MVP
MVP
Author

thnx maxgro........if i want to do in frnt end.  how to do this?  without creating new field in bakend?