Discussion Board for collaboration related to Creating Analytics for QlikView.
I hope someone of you could help me.
I Need to create a datefield but I dont have everything needed.
I have a month-field (txnper = '2') and I have a year-field (txnyear = '2016'). This are not datefields.
How can i create from this two fields a new one called txndate with entry of the last day from February 2016 (29.02.2016)
I got through many Posts here, but I could find anyone, which has not a dateformat as base.
Thanks in advance.
Go to Solution.
Date(MonthEnd(MakeDate(txnyear, txnper)), 'DD.MM.YYYY') as Date
UPDATE: I would also add Floor in there to make sure that this is truly date
Date(Floor(MonthEnd(MakeDate(txnyear, txnper))), 'DD.MM.YYYY') as Date
IF(Floor( month-field ) = Floor(MonthEnd( year-field )),Value,0) as LastDay
last day from dimension month
Help - last day of Month
Last day of month Value
When loading the txnper/txnyear fields, add this line to the load:
Date(Floor(MonthEnd(MakeDate(txnyear, txnper)))) as txndate,
MakeDate - create a date of the 1st of the relevant period
MonthEnd - get the last day (including time to the last second) of the month
Floor - drop the time portion
Date - format the date using the default date format set in your environment (DateFormat variable)
Truely Date means?
No Time Involvement, is it?
Yes, MonthEnd includes time as well
Okay, got it
thank you so much for all your help.
Here you are your solution:
It return the last day of current month
I hope it help you!