Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

date set analysis

Hi All , i have 2 questions:

first: i have this set: sum({$<Year={$(vCurrentYear)}>}Sales.Amount), it sales for each month of current year (month is  a dimmension, vCurrentYear variable =Year(Today()) ), i get results for 2014 jan, 2014 feb etc, till current month (may), but i wont to see current month, and i try this set but it dosnt  work: sum({$<Year={$(vCurrentYear)},Month={" <$(=vCurrentMonth)" }>}

vCurrentMonth variable = Month(Today())

second:  i have this variable, it returs me current month:

vCurrentMonth variable = Month(Today())

how ican declare variable wich returs me previuos year month?

vCurrentMonth variable = Month(Today()) =  2014 May

vPreviousYearMonth variable = ?????? = 2013 May

Please help.

4 Replies
tresesco
MVP
MVP

vPreviousYearMonth = MonthName(AddMonhts(Today(), -12))

Anonymous
Not applicable
Author

To get Previous Year Month

Let vPrevYrMonth = MonthName(AddYears(today(),-1))

Regards

Nitin

brijesh1991
Partner - Specialist
Partner - Specialist

Let vPrevYrMonth = MonthName(AddDays(today(),-365))

ha ha ha... nititn!!!

tresco

Anonymous
Not applicable
Author

This can be wrong if there is a leap year in between...................