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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
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

   

   

1 Solution

Accepted Solutions
Anil_Babu_Samineni

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

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