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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Bar chart

hey all ,

i  am creating a bar chart with a dimenssion of Month ,

i need to calculate a sum of amount on each month for 2 years obviously will show two bar next to each other in a single month..

Is it possibel to add one last bar calculating YTD ?

Thank you hope you can help.


14 Replies
tresesco
MVP
MVP

Try to share a sample data set(may be in excel) explaining the expected output there.

mario-sarkis
Creator II
Creator II
Author

Month Year Sum of Amount
Jan20151000
Feb 20151500
Mar20152000
Apr20152500
May 20153000
Jun20154500
July 20155200
Aug20152500
Sep 20151500
Jan20141200
Feb 20141700
Mar20142500
Apr20143000
May 20143200
Jun20144700
July 20145500
Aug20142800
Sep 20141600
Oct20142500
Nov20143000
Dec20144500

YTD 2015YTD 2014
2370026200(as till Sep2014)

need to show these in a bar Chart

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

PFA...

mario-sarkis
Creator II
Creator II
Author

hi Ace

tresesco
MVP
MVP

May be like attached?

Input:
LOAD Month,
       Year,
       MakeDate(Year, Month(Date#(Month, 'MMM'))) as Date,
       Amt
  INLINE [
    Month,Year, Amt
Jan,2015,1000
Feb,2015,1500
Mar,2015,2000
Apr,2015,2500
May,2015,3000
Jun,2015,4500
July,2015,5200
Aug,2015,2500
Sep,2015,1500
Jan,2014,1200
Feb,2014,1700
Mar,2014,2500
Apr,2014,3000
May,2014,3200
Jun,2014,4700
July,2014,5500
Aug,2014,2800
Sep,2014,1600
Oct,2014,2500
Nov,2014,3000
Dec,2014,4500

];
NoConcatenate
Output:
Load
      Date,
      Month,
      Year,
      Sum(Amt) as Amount
Resident Input group by Date, Year, Month Order By Date; 
Drop Table Input;

Concatenate
Load Distinct

      'YTD' as Month,
      Year
Resident Output

Current Year Exp:

If(Month='YTD',RangeSum(Above(Sum({<Year={"$(=Year(Today()))"}>}Amount),12-Month(Today())+1,$(vCurrMonth))),Sum({<Year={"$(=Year(Today()))"}>}Amount))

Last Year Exp:

If(Month='YTD',RangeSum(Above(Sum({<Year={"$(=Year(Today())-1)"}>}Amount),12-Month(Today())+1,$(vCurrMonth))),Sum({<Year={"$(=Year(Today())-1)"}>}Amount))

Untitled.png