Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

variable

Hi All ,

Can someone please explain me what does this below two variables do ?

Iam clear about the first variable vReportBegning  this will give me last thirteen months data..

I am confised with the second vairable vReportMonthAccumalate ..

Let vReportBegning = Date(MonthStart(AddMonths(Today(),-13)));

Let vReportMonthAccumalate = MonthStart(AddMonths(Date#('$(vReportBegning )'),-1));

I want to get the 13 monhts from the second variable also..

how do i alter the second variable ?

Thanks in advance

8 Replies
tresesco
MVP
MVP

The second variable is equivalent to:

Date(MonthStart(AddMonths(Today(),-14)));

Anil_Babu_Samineni

change 13 to 14 ?

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
smilingjohn
Specialist
Specialist
Author

Hi trsseco ,

if i want to make the second variable vReportMonthAccumalate   also to give 13 months ...how do i get it

tresesco
MVP
MVP

The first variable gives that, you can use the same expression or the variable itself.

smilingjohn
Specialist
Specialist
Author

Is there a way to get the uouptu for 13 months using the below variable only ?

Let vReportMonthAccumalate = MonthStart(AddMonths(Date#('$(vReportBegning )'),-1));


Because i have to use the first variable in the second as it is the requirement ...

Thanks

tresesco
MVP
MVP

I guess, you better explain your actual requirement here rather than just talking about the variables. It seems that problem could be somewhere else, because trying for different expressions for same expected output doesn't make a lot of sense.

jyothish8807
Master II
Master II

Try like this then:

Let vReportMonthAccumalate = $(vReportBegning )


It will give you 13 months again

Best Regards,
KC
sasiparupudi1
Master III
Master III

in the script

Set vReportBegning = Date(MonthStart(AddMonths(Today(),-13)));

Let vReportMonthAccumalate = 'MonthStart(AddMonths($' &'(=vReportBegning),-1))';

in the UI$(=vReportMonthAccumalate)-$(=vReportBegning)