Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabum
Creator
Creator

calculate the previous 12 months

Hi All

         I want to calculate previous 12 months of Sales in Script level (In script level ).

         Then after , I want to show that field in Table View .....

Thanks

Madhu

8 Replies
sunny_talwar

Are you looking to sum last 12 months for each row of data? Can you share some data?

madhubabum
Creator
Creator
Author

Hi Sunindia,

I'm already calculated the previous 12 months in script level.....

But , I want to show that calculated field in Table view.....

How can we achieve this one .......

Thanks for your reply...

Thanks

Madhu

sunny_talwar

You have already calculated it??? I am not sure what you are looking for, would you be able to share a sample?

Best,

Sunny

madhubabum
Creator
Creator
Author

If(date(floor(Date))> AddMonths(Today(), -12), 1) AS Last12Month

prma7799
Master III
Master III

Try this,

SUM({$<FinancialYear=,MonthName=,FiscalYear={$(=max(FiscalYear)-1)},Quarter=

,[Date]={">=$(=MonthStart(max({$<FiscalYear={$(=max(FiscalYear))}>}[Date]),-12))<=$(=addmonths(max({$<FiscalYear={$(=max(FiscalYear))}>}[Date]),-12))"}>}[Sales])

pratap6699
Creator
Creator

in UI-->sum({<=$(Max(year))-1>}sales) or sum({<=$(Max(month))-12>}sales)

in script level-->use if() condition

madhubabum
Creator
Creator
Author

Hi  Pratap budati

i am already done with calculation in script level .......but i want to show in table view....how can we acheive?

jyothish8807
Master II
Master II

Hi Madhu,

If you have this field in script, then it will appear in table viewer.

Try to do a resident load of that table and drop the actual table and see if you can see that field in table viewer.

Regards

Jyothish KC

Best Regards,
KC