Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

My month_n script is not working ?

Hi All


I have below script work fine :-


SubField([Expected Close Date],'-' ,3) as Year,


Now i need to create month_n field :-


(year(today()) - year(@50:60T)) * 12 + month(today()) - month(@50:60T) + 1 as Month_n,


But above script return no value.


The purpose of month_n is allow me select


month_n = 0 , that is current month.

month_n = 1 , that is Next month

etc

.

Can some one help me.


Paul

   

   

Labels (1)
1 Solution

Accepted Solutions
Anil_Babu_Samineni
MVP
MVP

Try this?

=(year(today()) - year(Date#([Expected Close Date],'MM-DD-YYYY'))) * 12 + month(today()) - month(Date#([Expected Close Date],'MM-DD-YYYY')) + 1 as Month_n

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
paulyeo11
Master
Master
Author

My QVW

Anil_Babu_Samineni
MVP
MVP

Try this?

=(year(today()) - year(Date#([Expected Close Date],'MM-DD-YYYY'))) * 12 + month(today()) - month(Date#([Expected Close Date],'MM-DD-YYYY')) + 1 as Month_n

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

Thank you

Paul