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.
adoteykwame
Contributor

Date field formatting

Hi,

Is there a way to align all the records in this date field to the left.

1 Solution

Accepted Solutions

Re: Date field formatting

Hi,

One solution is as Sivaraj suggests above. However, if QlikView detects a number as a date, it aligns to the right (according to its numeric value). If it understands the value as a string instead, then it will be aligned to the left, by default. If you operate those dates, it's likely you will not get correct results, as you have both numeric and literal values.

The best way to do it is to change the LOAD statement in your script and set all date fields to have the same format, using the Date() and Date#() functions.

Hope that makes sense.

Miguel

7 Replies
sivarajs
Valued Contributor II

Re: Date field formatting

Goto chart properties--> Presentation tab --> Change Alignment Numbers to left

whiteline
Honored Contributor II

Re: Date field formatting

Hi.

It seems that your  [Expiry date] field contains number and string values.

By default strings are aligned to the left while numbers to the right.

I suggest to deside witch type of values you  need and convert them correspondingly, instead of just changing the view alignment.

Re: Date field formatting

Hi,

One solution is as Sivaraj suggests above. However, if QlikView detects a number as a date, it aligns to the right (according to its numeric value). If it understands the value as a string instead, then it will be aligned to the left, by default. If you operate those dates, it's likely you will not get correct results, as you have both numeric and literal values.

The best way to do it is to change the LOAD statement in your script and set all date fields to have the same format, using the Date() and Date#() functions.

Hope that makes sense.

Miguel

adoteykwame
Contributor

Re: Date field formatting

Hi guys,

@Sivaraj Seeman I just tried that and that didn't work also

Re: Date field formatting

Hi,

Sure there is a way to pull data in the correct way, but not knowing how the values are in the source, it's difficult to set an example. Using either Date() or Date#() will do, as it does in most cases. Anyway, post a couple of sample lines here so we can help further.

Miguel

adoteykwame
Contributor

Re: Date field formatting

Hi Miguel Angel Baeyens

I didnt change the field name in the chart all along, it's now aligned to the right as date format

Thanks so much

whiteline
Honored Contributor II

Re: Date field formatting

Hi.

It's strange that you have both numbers and strings. It seems that you LOAD  this field into more than one table. So in one case you've converted them properly unlike the others.

From the other hand the source contains dates in different formats and you didn't use alt() function to handle all of them.

You could post all LOAD statements where [Expiry date] is contained.

And an example of your source data would also be helpful.

Community Browser