# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
Creator II

## Maximum Month per Quarter in Trending Chart

Hi,

I want to show Trending bar chart where in each Quarter we have to pick the maximum Month of each Quarter.

For Example:

2017,Q1,Jan,100

2017,Q1,Feb,100

2017,Q1,Mar,100

2016,Q4,Oct,200

2016,Q4,Nov,200

2016,Q4,Dec,200

2016,Q3,July,300

2016,Q3,Aug,300

2016,Q3,Sep,300

as per the data we have to show the bar ghaph where Quarter is our dimension but we have to show sum of the sales where month is maximum based on quarter . As well as i need to show the Comparison based on the Current Quarter and Previous Quarter but when the user select any month that time it will pick the maximum month of the previous quarter.

Regards,

Nisha

1 Solution

Accepted Solutions
Luminary Alumni

Hi,

What you can do is create a flag in mastercal to identify the maximum month of the quarter, like below.

if(Monthname(Date) = Monthname(quarterend(Date)),1,0) as QuarterMaxMonthFlag

From xyz;

Now you can use this flag in set analysis to get sales of maximum month.

Sum({<QuarterMaxMonthFlag = {1}>}Sales)

Regards,

Kaushik Solanki

Regards,
Kaushik
3 Replies

Is this you are expecting

Or this?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Luminary Alumni

Hi,

What you can do is create a flag in mastercal to identify the maximum month of the quarter, like below.

if(Monthname(Date) = Monthname(quarterend(Date)),1,0) as QuarterMaxMonthFlag

From xyz;

Now you can use this flag in set analysis to get sales of maximum month.

Sum({<QuarterMaxMonthFlag = {1}>}Sales)

Regards,

Kaushik Solanki

Regards,
Kaushik
Partner

Based on Kaushik's answer, and knowing it has a worse performance, what you can do is the following:

sum(Aggr(

if(Date=QuarterEnd(Date),sum(Value),0)

,Date))

For that, you must have your Date in a date format (DD/MM/YYYY or whatever).

But the flag option is way better: aggrs and ifs are no good.

Regards,

Sorin.