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

Problems showing Prev month sales.

Hi.

I'm new in Qlik sense.

I need to show this

 

2018-01Previus MonthForecast
Admin

30

25

32
Seller 1334045
Seller 2433540

I use Sql server Via Oledb, I have Date, Year, Month and cuantity fields in my query.

I try defining variables on the script section and use a measure

The variables have allredy been Checked.

Sum({<Year={"$(=Max(Year))"}, YearMonth={"<=$(=vPriorMonthYear)"}, Year=,Month=>}Cuantity)

On a pivot Table. But I always recieve the same values on "2018-01" and Previus Month columns.

1 Reply
sunny_talwar

Why are you using <= vPriorMonthYear, do you need all years summed together or just the last month? Also, for 201801, the last Month will be in Year 2017. You might want to consider removing the set analysis from Year field because that is contradicting your YearMonth's set analysis.