Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
reema_dangwal
New Contributor

MTD and YTD bar in a single bar chart

Hi Everyone,

I need to create a chart that shows current month and YTD in dimension, and the corresponding measure value for them.
PFB the data.

MonthMonthNumAmount
Jan-191725
Feb-192549
Mar-193595
Apr-194759
May-195579
Jun-196595
Jul-197 
Aug-198 
Sep-199 
Oct-1910 
Nov-1911 
Dec-1912 
   

I am able to create the above as two separate charts(Dimesnion & Expression mentioned below).
//Script level variable:
Let vCurrMonth = Num(Month(today())-1);

1st chart:
Dimension:
Month
Expression:
Sum({<MonthNum= {'$(vCurrMonth)'}>}[Amount])

2nd Chart:
Dimension:
Year(Month)
Expression:
Sum({<MonthNum= {"<=$(vCurrMonth)"}>}[Amount])


Please suggest how can I show it in a single chart as shown in attached screenshot.

 

Thanks,
Reema