Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

sureshqv
Esteemed Contributor III

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

Re: RE:Date error

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

13 Replies

Re: RE:Date error

Try:

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

- Marcus

sureshqv
Esteemed Contributor III

Re: RE:Date error

thnx marcus,

Its shwng error in expression

PFAerror-date.png

Re: RE:Date error

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

sureshqv
Esteemed Contributor III

Re: RE:Date error

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

Re: RE:Date error

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

Re: RE:Date error

Hi Suresh,

Can you use the below command in the expression.

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

Thanks,

Sreeman

sureshqv
Esteemed Contributor III

Re: RE:Date error

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

MVP
MVP

Re: RE:Date error

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;

sureshqv
Esteemed Contributor III

Re: RE:Date error

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

Community Browser