Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Specialist
Specialist

Show current month and previous month data in bar chart qliksense

Hello everyone,

My requirement is to show the data for current month and previous month in bar chart.(Ex-one bar for August2020, second bar for Spet2020)

Dimension : Pays.Name

Measure :

Previous Year (Sept 20)

Sum({<Indicateur.Code = {'PO.1.10.c'},[Site.isYFPO]={'0'},[Site.Participe]={'49|50'},Date.Year=,[Date.MonthEnd]=,MonthYear=,[Date.Year]=,


NewTestvb1=, Date={">=$(=Addmonths(Monthstart(Max(Date)),-1))"}>}[Indicateur.Value])

 

==========================================

Current Year

if($(vChange)=0,

Sum({<Indicateur.Code = {'PO.1.10.c'},[Site.isYFPO]={'0'},[Site.Participe]={'49|50'},Date.Year=,[Date.MonthEnd]=,MonthYear=,[Date.Year]=,


NewTestvb1=, Date={">=$(=Monthstart(Max(Date)))"}>}[Indicateur.Value])

,

Sum({<Indicateur.Code = {'PO.1.10.c'},Date.Year=,[Date.MonthEnd]=,MonthYear=,[Date.Year]=,


NewTestvb1=, Date={">=$(=Monthstart(Max(Date)))"}>}[Indicateur.Value])


)

 

Aspiring_Developer_0-1603099009306.png

 

When i am taking the same thing in bar chart, it is returning total (sep202+sug202)for previous month bar instead of value for Aug2020.

Can anyone please help ?

@sunny_talwar @Kushal_Chawda 

1 Reply
sunny_talwar

@Aspiring_Developer may be try this for previous month

Sum({<Indicateur.Code = {'PO.1.10.c'}, [Site.isYFPO] = {'0'}, [Site.Participe] = {'49|50'}, [Date.Year], [Date.MonthEnd], MonthYear, [Date.Year],
 NewTestvb1, Date = {">=$(=MonthStart(Max(Date),-1))<$(=Monthstart(Max(Date)))"}>} [Indicateur.Value])