Qlikview - a real pleasure to work with
-
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013Perl scripts? Is regex possible with this Qlikview crap?
-
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013John Simmons / outlaw programmer wrote:
YYYY-MM-DD HH:MM:SS.FFF
Seriously? The format strings don't differentiate between "month" and "minute"? :wtf: 💩
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
John Simmons / outlaw programmer wrote:
YYYY-MM-DD HH:MM:SS.FFF
Seriously? The format strings don't differentiate between "month" and "minute"? :wtf: 💩
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Perhaps it's context sensitive.
Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
I like positive thinking.
Wrong is evil and must be defeated. - Jeff Ello
-
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013John Simmons / outlaw programmer wrote:
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')
In my geeky teens I would have thought, "oh wow, this is so cool, 4 levels of parens!" and shown it to all my friends (erm, wait, what friends???) who would have gone "wow, that IS cool!" (if I had any friends.) Now in my geeky 50's I'm with you -- I look at that and think, wow, what BS is this?
Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
-
John Simmons / outlaw programmer wrote:
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')
In my geeky teens I would have thought, "oh wow, this is so cool, 4 levels of parens!" and shown it to all my friends (erm, wait, what friends???) who would have gone "wow, that IS cool!" (if I had any friends.) Now in my geeky 50's I'm with you -- I look at that and think, wow, what BS is this?
Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
Marc Clifton wrote:
"oh wow, this is so cool, 4 levels of parens!"
And your geeky friends would have mocked you because there are 5 levels... :laugh:
Sent from my Amstrad PC 1640 Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013I wonder that any of these expressions returns something, since none of them has balanced parentheses. On the other hand, I have never heard of "Qlikview" (fortunately), and perhaps this "language" can't cope with balanced parentheses :laugh:
-
Marc Clifton wrote:
"oh wow, this is so cool, 4 levels of parens!"
And your geeky friends would have mocked you because there are 5 levels... :laugh:
Sent from my Amstrad PC 1640 Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
John Simmons / outlaw programmer wrote:
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')
In my geeky teens I would have thought, "oh wow, this is so cool, 4 levels of parens!" and shown it to all my friends (erm, wait, what friends???) who would have gone "wow, that IS cool!" (if I had any friends.) Now in my geeky 50's I'm with you -- I look at that and think, wow, what BS is this?
Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
qlik example
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')
This is the necessary stage of declarative programming* that occurs right before AI takes over and writes all the code for us. :rolleyes: Yes, it's like SQL and yes I hate SQL also*. :laugh: <bumpersticker>Real Devs Hate SQL</bumpersticker>
-
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013How about
dayname(vTEST)
Assuming / is OK instead of -
-
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013Does this work for you?
SET DateFormat='YYYY-MM-DD';
LET vTEST = '2018-09-05 13:27:14.5';
dayname(vTEST)
-
John Simmons / outlaw programmer wrote:
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')
In my geeky teens I would have thought, "oh wow, this is so cool, 4 levels of parens!" and shown it to all my friends (erm, wait, what friends???) who would have gone "wow, that IS cool!" (if I had any friends.) Now in my geeky 50's I'm with you -- I look at that and think, wow, what BS is this?
Latest Article - A Concise Overview of Threads Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
I'm somewhere between my teens and 50's and two parens would've been fine for me ;p
Best, Sander Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
John Simmons / outlaw programmer wrote:
YYYY-MM-DD HH:MM:SS.FFF
Seriously? The format strings don't differentiate between "month" and "minute"? :wtf: 💩
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Perhaps the feature "common sense" was integrated. If it sees HH, then the next format will treat minutes regardless of the casing ;P
-
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wantedA Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the
FLOOR
function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example. Have I mentioned how much I hate working in Qlikview?".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013This will give you the date portion of the string:
LET vTEST = '2018-09-05 13:27:14.5';
LET vResult = Date(vTEST, 'YYYY-MM-DD'); <-- vResult = 2018-09-05Also, 'MM' for months, 'mm' for minutes.
Sincerely, -Mark