Qlik Community

Ask a Question

App Development

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

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bertrand01
Contributor III
Contributor III

Divide DataX(Month) by DataY(Previous Month) in a Monthly Line chart

Hi everybody,

I have to make a Monthly Line chart. 
Basically,  I want to divide DataX(Month) by DataY(Previous Month) in a Monthly Line chart. 

I have tried this kind of set analysis : 

=Date={"=AddMonths(Date,-1)

But I get the same value as the current month ?

Any idea what I can try ? I would not like to make this in the load script.

 

3 Replies
kashyap
Partner
Partner

Hi

Try this

Current

Sum({<[Date]={">=$(=MonthStart(max([Date])))<=$(=Date(Max([Date])))"}>}Value)

Previous

Sum({<[Date]={">=$(=MonthStart(Addmonths(max([Date]),-1)))<=$(=(Addmonths(max([Date]),-1)))"}>}Value)

Thanks

bertrand01
Contributor III
Contributor III
Author

 

Thanks, but this can only work for max month, not for every month as it is based on the max date.
I want it to work in a line chart for every month, month being the X axis.

kashyap
Partner
Partner

hi

try this 

Sum(Value)

/

Above(Sum(Value))

Sort according to month

Thanks