Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Maxstring

Hi

I have a date field , which has 4 dates and i need to load data based on latest date , some how maxstring(date) does not work in the script , but if i use same maxstring(date) in UI in a list box expression it works , i mean it gives the maximum date value ... can i know what could be the reason and how i can fix this.I am not sure what datatype of column it is in database.Tried max(date) too.

Thanks

1 Solution

Accepted Solutions
calvindk
Creator III
Creator III

This should do it.

BASE:

LOAD Max_Ext_Date,

     CR#,

     ID

FROM

C:\Users\tv04\Desktop\test.xls

(biff, embedded labels, table is Sheet1);

INNER JOIN(BASE)

Load Max(Max_Ext_Date) as Max_Ext_Date

FROM C:\Users\tv04\Desktop\test.xls

(biff, embedded labels, table is Sheet1);

Edit: had a brainbleed..

View solution in original post

8 Replies
rustyfishbones
Master II
Master II

Sometimes Date Function in Qlikview don't work because you need to define the Date Format

for it to work

So try this maybe:

mAX_dATE.png

hope it works for you

Not applicable
Author

i tried that also , unfortunately the data is not in one format ,

few dates are like M/D/YY , some are MM/DD/YYYY , i tried both formats but it does not work.

There is only one value some old date in M/D/YY format , which i dont need anyways , rest all are in MM/DD/YYYY

rustyfishbones
Master II
Master II

Ok so when you have a field that contains 2 formats and you need to convert to 1

You can try the ALT Function

So it would look like this for the Date field and then you can try the MAX(Date)

mAX_dATE.png

Not applicable
Author

ok so using the above syntax i am able to get all my values of date column in same format , but still unable to load data where date = max(date)

rustyfishbones
Master II
Master II

I am not sure what the problem is

where any of my posts helpful, please give 5 points if helpful 🙂

calvindk
Creator III
Creator III

Please post a data reduced sample qvw, so we can have a look at the script.

Not applicable
Author

Attached sample data , i want data to be loaded only for max date which is 4/26

calvindk
Creator III
Creator III

This should do it.

BASE:

LOAD Max_Ext_Date,

     CR#,

     ID

FROM

C:\Users\tv04\Desktop\test.xls

(biff, embedded labels, table is Sheet1);

INNER JOIN(BASE)

Load Max(Max_Ext_Date) as Max_Ext_Date

FROM C:\Users\tv04\Desktop\test.xls

(biff, embedded labels, table is Sheet1);

Edit: had a brainbleed..