Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
arjunmadhusudan
Contributor III
Contributor III

find highest sales for each month in a time series bar chart

I have the following data:

   

CompanyMonth YearSales
aJan-1710
aFeb-1720
aMar-1711
aApr-1713
bJan-1740
bFeb-1745
bMar-172
bApr-174
cJan-1755
cFeb-173
cMar-1740
cApr-171

I need a times series bar chart which has X axis = Month Year and  Y axis  =  Highest sale for that time period group by company

For example for Jan-17 I should get sale  = 55 which for company c.

12 Replies
sunny_talwar

We have no idea what you are seeing, do you mind sharing what you have so that we can figure out what might be wrong

HarishG
Partner - Contributor III
Partner - Contributor III

Create a variable like this,  vExclude=GetFieldSelections(Company),

in expression instead of sum(Sales), use below expression

Sum({<Company=-{'$(vExclude)'}>}Sales)


In above case, if you haven't selected anything in Company field, the charts shows the total of sales.

or

Simply use this =Sum({1-$}Sales), but if you don't select any value in company field, the calculation shows 0.

qliksus
Specialist II
Specialist II

Another way of doing it is as below

( (max({<Company=e(Company)>}Sales)=max({<Company=e(Company)>}total<MonthYear>Sales))* -1) * max({<Company=e(Company)>}total<MonthYear>Sales)

But both are gonna give the same result