Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jduluc12
Creator
Creator

Date manipulation in script

Hi,

I have this script and it is not working.

tan:
LOAD * INLINE [
F1, F2
09/07/2021, ren
09/05/2021, rte
];

tan1:
load * Resident tan
Where F1 > date('09/06/2021', 'MM/DD/YYYY');

DROP TABLE tan;

 

I was expecting the table 'tan1' to have only the first row but tan1 is not even getting created.

what is wrong with it?

Thanks

Labels (1)
1 Solution

Accepted Solutions
Qlik1_User1
Specialist
Specialist

@jduluc12 

Try this

tan:
LOAD * INLINE [
F1, F2
09/07/2021, ren
09/05/2021, rte
];

noconcatenate

tan1:
load * Resident tan
Where F1 > date('09/06/2021', 'MM/DD/YYYY');

DROP TABLE tan;

 

View solution in original post

3 Replies
Qlik1_User1
Specialist
Specialist

@jduluc12 

Try this

tan:
LOAD * INLINE [
F1, F2
09/07/2021, ren
09/05/2021, rte
];

noconcatenate

tan1:
load * Resident tan
Where F1 > date('09/06/2021', 'MM/DD/YYYY');

DROP TABLE tan;

 

nsm1234567
Creator II
Creator II

Just to add some context to this reply (which is right), in Qlikview, when you load a table that has exactly the same column names as a previous table it gets "concatenated" to the previous table.

So what your code is doing is concatenating or unioning tan and tan1 so that they become one table called "tan" and then you're dropping that table.

If you remove the drop table statement you'll see that the tan table actually has three rows which represents the merging of the two datasets you loaded

MayilVahanan

Hi @jduluc12 

For your scenario, you can directly use where condition in first load itself.

tan:
LOAD * INLINE [
F1, F2
09/07/2021, ren
09/05/2021, rte
]Where F1 > date('09/06/2021', 'MM/DD/YYYY');

If you are doing some manipulation, then you can use resident load.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.