Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to write below SQL script in Qlikview.
'FM' + right('0'+ convert(varchar,datepart(mm, DATEADD(MONTH, -3, Period))),2) + '-' + convert(varchar(3),datename(month, Period)) as Fin_Month
Can someone help me out please ?
Thanks
'FM' & num(addmonths(Period,-3),'00') & text(month(Period))
should do it
Hi Dion,
I tried your solution but did not work in my case.
I’ve done like this in the qlikview.
'FM' & num(addmonths(Period,-3),'00') & text(month(Period)) as Fin_Month
But finally I ended up with the following values in the list box.
FM40909Apr, FM40940May… so on.
Actually, In the SQL server I got values like this: FM01-Apr, FM02-May….so on
Do you have any other solution ?
Thanks
Hi,
I've made a mistake and forgot the month function.
'FM' & num(month(addmonths(Period,-3)),'00') & text(month(Period))
Try this.
Hi
Try like this
'FM' & num(month(addmonths(Period,-3)),'00') &'-' & text(month(Period))
Perfectly working. Thank you very much Dion!