Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pra_kale
Creator III
Creator III

Current Month in Number Require But April is a starting Month

Hi,

I am creating Two variables for Year and Month, as I am going to use them in my script. But in my data current Year shows as 2016 and Months are starting From April.

Means April is my starting Month i.e. 1 and May as 2 and June as 3 and so on...

I am able to resolve the problem of current year by following formula..

=Year(Today())+1 which gives me out-put as 2016. I know how to get last month i.e. by =num(Month(Today()))-1 which gives me out-put as 10 which is October. But, as I mentioned earlier in my data Year starts from April, October is not 10 but  7 and March is 12.

I don't know how resolve this problem. Please help to resolve the issue.

Thanks in advance.

1 Solution

Accepted Solutions
PrashantSangle

Hi,

You can try like

num(Month(Today())-4)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

5 Replies
PrashantSangle

Hi,

You can try like

num(Month(Today())-4)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

for jan, feb, Mar

you can write

if(num(Month(Today()))>3,num(Month(Today())-3),num(Month(Today())+3))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tresesco
MVP
MVP

Or, simply  =Num(Month(AddMonths(Today(),-4)))

pra_kale
Creator III
Creator III
Author

Thanks for your help...vary useful.

tamilarasu
Champion
Champion

Another solution,

=num(Month(Today())-(Num(Month(Today()))-Mod(month(today())-4, 12)))