Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Store month as 0month

Dear all,

I create a month variable like this:

varCurrentMonth = num(Month(Today()));

This works fine. However, the month in my dataset is denoted like this: 09, 08 etc... Any thoughts on how I can transform the 9 into 09.

7 Replies
t_moutault
New Contributor III

Re: Store month as 0month

hi Marc,

try this varCurrentMonth = num(Month(Today()),'00');

florentina_doga
Contributor III

Re: Store month as 0month

try this

=if(len(num(Month(Today())))=1,'0'&num(Month(Today())),num(Month(Today())))

balrajahlawat
Esteemed Contributor

Re: Store month as 0month

may be this?

varCurrentMonth = right(num(Month(Today())),1);

sureshqv
Esteemed Contributor III

Re: Store month as 0month

if you have fixed value then try below

nine.PNG

jjbom1990
Contributor

Re: Store month as 0month

that would mean that when it is oktober the month would be 010, does not seem to be the requested outcome.

MVP
MVP

Re: Store month as 0month

Try this:

varCurrentMonth = Num(Month(Today()), '00');

Re: Store month as 0month

Sometimes, the problem with Date Field,

Perhaps this

varCurrentMonth = Num(Month(Floor(Today(),'DateFieldFormat'),'MM'))