Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Rahul__FCE
Contributor
Contributor

Trying to create a measure for previous month data

Actually I am trying to create a measure for  pricing based on current month , previous month and same month last year. I have used the following syntaxes :

 

This_month = avg({<Month={$(=Month)}, Year={$(=Year)}>} Unit_Price_KG)

Previous_month = avg({<Month = {"=$(=Month - 1)"}, Year = {"=$(=Year)"}>} Unit_Price_KG)

same_month_last_year = avg({<Month={$(=Month)}, Year={$(=Year-1)}>} Unit_Price_KG)

 

The measure "this_month" and "same_month_last_year" is working. The measure for "Previous_month " is not working and is reflecting the data for the current month.

Labels (1)
2 Replies
anat
Master
Master

Can you bypass Month field in Previous_month metric

Rahul__FCE
Contributor
Contributor
Author

Sorry , I did not understand. Could you please elaborate