Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Vinni2000
Contributor III
Contributor III

Want to show this year puchase amount vs last year puchase amount using bar chart

i have invoice date '20200831' format in purchase order data so now i want to compare thise year purchase amount vs last year purchase amount by months using bar chart 

1 Reply
_Iswarya_
Contributor III
Contributor III

Hi @Vinni2000 ,

First get the year in the script using:

Year(Date#(FieldName, 'YYYYMMDD')) as Year

Then in the front end measure add the below expression:
 
Current Year:

Sum({<Year = {"$(=Max(Year))"}>}purchase_amount)

 

Previous Year:

Sum({<Year = {"$(=Max(Year)-1)"}>}purchase_amount)