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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
saivina2920
Creator
Creator

How do we get count less than 5 days from current date

How do we get count less than 5 days from current date.

I have "column A" which contains varchar data type and i want to get count of less than 5 days from current date.

What expression we can use..?

Labels (1)
16 Replies
Vegar
MVP
MVP

Try to get the correct connect syntax by using the connect / select syntax
by using the connect wizard inside the script editor.
saivina2920
Creator
Creator
Author

I deleted all the scripts and re-connect it again. Script Generated Successfully with LOAD and SQL Select statement.
I just changed the field like "Date(Floor(Date#(EmpJoinDate,'DDMMMYYYY:hh:mm:ss')),'DD-MM-YYYY') as EmpJoinDate" in LOAD part and Re-Load it again.
But, Again it is loading blank for EmpJoinDate.
Not sure, how i could proceed further...?
Vegar
MVP
MVP

Maybe the assumed format is not correct?
Could you post a picture of an list box with EmpJoinDate if you load that field straight from the database without any manipulation? You could also pay attention to the alignment of the values in the list box, is the EmpJoinDate left or right aligned?

SQL SELECT
EmpJoinDate
FROM
DB.dbo.Table
;
saivina2920
Creator
Creator
Author

The tricky is, the same will be loading successfully in the LOAD(without converting date) .
But, while converting the same field in the LOAD, it won't be list.
What is the magic behind this....?

Same data and Screenshot attached.

saivina2920
Creator
Creator
Author

Some rows are blank in the "EmpJoinDate" Column.
Because of this...????
Vegar
MVP
MVP

By looking at the picture I notice that Your date format is not DDMMMYYYY:hh:mm:ss but MM/DD/YYYY hh.mm.ss
Try changing your expression inside the LOAD to:
Date(floor(Date#(EmpJoinDate,'MM/DD/YYYY hh.mm.ss'))) as EmpJoinDate
saivina2920
Creator
Creator
Author

Excellent...You Rock...