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

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

12 month

Dear All

I Select year 2017 and Month July then i want to get a value last 12 month separately. it as below

I SELECT

MONTH FIELD =   JULY

YEAR FIELD    = 2017

THEN I WANT VALUE AS GIVEN BELOW

JULY 2016

AUGUST 2016

SEPTEMBER 2016

OCTOBER 2016

DECEMBER 2016

NOVEMBER 2016

JANUARY 2017

FEBRUARY 2017

MARCH 2017

APRIL 2017

MAY 2017

JUNE 2017

I Already use Tran cal given below

Trandatecalender:

LOAD

DAY(TRAN_DATE) AS TRAN_DAY,

DATE(TRAN_DATE) AS TRAN_DATE,

DATE(monthstart(TRAN_DATE), 'MM-YYYY') as MONTH_YEAR,

WEEK(TRAN_DATE) AS TRAN_WEEK,

YEAR(TRAN_DATE) AS TRAN_YEAR,

MONTH(TRAN_DATE) AS TRAN_MONTH,

MONTH(TRAN_DATE) &'-'& WEEK(TRAN_DATE) AS MONTH_WEEK;

LOAD DATE (TRAN_MINDATE + ITERNO() -1) AS TRAN_DATE WHILE (TRAN_MINDATE + ITERNO () -1) <= NUM (TRAN_MAXDATE);

LOAD

MIN(TRAN_DATE) AS TRAN_MINDATE,

MAX(TRAN_DATE) AS TRAN_MAXDATE

RESIDENT PL;

Please help get a last 12 month value

sagara

Labels (1)
2 Replies
Anil_Babu_Samineni
MVP
MVP

Are you expecting this in Script / UI ??

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
nitin_pawar
Partner - Contributor II
Partner - Contributor II

Hi,

If you are using in UI level so use below expression. I hope it will help you.

sum({<Date={'>$(=MonthStart(max(Date),-12))<$(=MonthEnd(  max(Date),-1))' },MonthYear=,YEAR=>}Sales)