Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

Please help me out

1 Solution

Accepted Solutions
MVP
MVP

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

good idea sunindia!

small change

=Date(Today(), 'WWWW, DD') &

     Pick(wildmatch(Day(Today()),

            1,21,31,

            2,22,

            3,23,

            '*'),

            'st ', 'st ', 'st ',

            'nd ', 'nd ',

            'rd ', 'rd ',

            'th '

    )

& Date(Today()+v, 'MMM YYYY')

12 Replies
chris_deniziak
Contributor

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

You could use this in your text box:

=WeekDay(Today()) &', '&Date(Today(),'DD MMM YYYY')

You will also have to change your DayNames variable in the load script to this:

SET DayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';


Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

Try this:

=Date(Today(), 'WWWWWW DD MMM YYYY')

Best,

S

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

Or another alternative:

=Date(Today(), 'WWWW, DD') & 'th ' & Date(Today(), 'MMM YYYY')

HTH

Best,

S

chris_deniziak
Contributor

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

Having 'th' will induce 1th, 2th, 3th, etc... You'll need more logic if you use that approach.

buzzy996
Honored Contributor II

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

=Date(Today(), 'WWWW') &','& Date(Today(),'dd') &'th '& Date(Today(),'MMM YYYY')

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

Smart thinking Chris. I did not think about it.

I guess we can use a Match function to determine 'st' or 'th' or any other, may be.

Best,

S

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

My bad, not the match function, but the Pick function:

=Date(Today(), 'WWWW, DD') &

Pick(Day(Today()), 'st ', 'nd ', 'rd ',

                    'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ',

                    'st ', 'nd ', 'rd ',

                    'th ', 'th ', 'th ', 'th ', 'th ', 'th ', 'th ',

                    'st ')

& Date(Today(), 'MMM YYYY')

Best,

S

MVP
MVP

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

good idea sunindia!

small change

=Date(Today(), 'WWWW, DD') &

     Pick(wildmatch(Day(Today()),

            1,21,31,

            2,22,

            3,23,

            '*'),

            'st ', 'st ', 'st ',

            'nd ', 'nd ',

            'rd ', 'rd ',

            'th '

    )

& Date(Today()+v, 'MMM YYYY')

Re: I want to display today's Date in the text box in the format e.g. WEDNESDAY, 18th Feb 2015

Very nice. I like the collaboration we have went through within this post.

Thanks for proposing further simplification of the expression.

Best,

S

Community Browser