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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to assign only Max of Fiscal Month in front of MonthYear Dimension

Hi Experts,

I have a data set where i have MonthYear,Sales and fiscalYear.

I have to create a table in the front end where i have show Sales by MonthYear and another column where i need to show the max month of  each fiscal year.

Below is the expected output:

  

MonthNamesum(Sales)Max fiscal MonthDesired Output of column
8574
Apr 201512Jul-2016Mar-2016
May 2015234Jul-2016Mar-2016
Jun 20153Jul-2016Mar-2016
Jul 2015534Jul-2016Mar-2016
Aug 20156435Jul-2016Mar-2016
Sep 201534Jul-2016Mar-2016
Oct 201532Jul-2016Mar-2016
Nov 201535Jul-2016Mar-2016
Dec 20154Jul-2016Mar-2016
Jan 2016345Jul-2016Mar-2016
Feb 201625Jul-2016Mar-2016
Mar 201656Jul-2016Mar-2016
Apr 201678Jul-2016Jul-2016
May 2016657Jul-2016Jul-2016
Jun 201645Jul-2016Jul-2016
Jul 201645Jul-2016

Jul-2016

Input Data:

LOAD MonthName(MonthYear) as MonthName,MonthYear,Sales,fiscalYear Inline

[

MonthYear,Sales,fiscalYear

04/01/2015,12,2016

05/01/2015,234,2016

06/01/2015,3,2016

07/01/2015,534,2016

08/01/2015,6435,2016

09/01/2015,34,2016

10/01/2015,32,2016

11/01/2015,35,2016

12/01/2015,4,2016

01/01/2016,345,2016

02/01/2016,25,2016

03/01/2016,56,2016

04/01/2016,78,2017

05/01/2016,657,2017

06/01/2016,45,2017

07/01/2016,45,2017

];

Thanks in Advance

1 Solution

Accepted Solutions
sunny_talwar

Try this for Sales Output

=Aggr(FirstSortedValue(TOTAL <fiscalYear> Aggr(Sum(Sales), MonthYear), -MonthYear), MonthYear, fiscalYear)

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

May be try this as your expression:

=Aggr(Max(TOTAL <fiscalYear> MonthYear), MonthYear, fiscalYear)


Capture.PNG

Anonymous
Not applicable
Author

Hi Sunny,

Thanks for your quick reply..

there is one more thing i want to do in the same line .. like I also want to show the value of sum(sales) of last month of each fiscal to all the month of that fiscal.

Output should be like below:

   

MonthNamesum(Sales)Max fiscal MonthDesired Output of columnSales Output
8574
Apr 201512Jul-2016Mar-201656
May 2015234Jul-2016Mar-201656
Jun 20153Jul-2016Mar-201656
Jul 2015534Jul-2016Mar-201656
Aug 20156435Jul-2016Mar-201656
Sep 201534Jul-2016Mar-201656
Oct 201532Jul-2016Mar-201656
Nov 201535Jul-2016Mar-201656
Dec 20154Jul-2016Mar-201656
Jan 2016345Jul-2016Mar-201656
Feb 201625Jul-2016Mar-201656
Mar 201656Jul-2016Mar-201656
Apr 201678Jul-2016Jul-201645
May 2016657Jul-2016Jul-201645
Jun 201645Jul-2016Jul-201645
Jul 201645Jul-2016Jul-201645
sunny_talwar

Try this for Sales Output

=Aggr(FirstSortedValue(TOTAL <fiscalYear> Aggr(Sum(Sales), MonthYear), -MonthYear), MonthYear, fiscalYear)

Capture.PNG