Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN 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_R
Partner - Specialist
Partner - Specialist

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

Thanks and Regards
Kashyap.R
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_R
Partner - Specialist
Partner - Specialist

hi

try this 

Sum(Value)

/

Above(Sum(Value))

Sort according to month

Thanks

Thanks and Regards
Kashyap.R