Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
kaushi2020
Creator II
Creator II

How to show data for Sales based on products from Previous year

Dear All, 

I have below data. 

Year ProductName Sales
2023 A 10
2023 B 20
2024 A 20
2024 B 30
2024 C 50

 

Assuming current year as 2024, I want to show ProductName from Last year. 

Here I want to show show sales for 2024 where ProductName = A and B (from Previous year)

Thanks in advance.

3 Replies
Chanty4u
MVP
MVP

Try this 

Sum({<Year={2024}, ProductName={"=ProductName = {'$(=Concat({<Year={2023}>} ProductName, ','))'}"}>} Sales)

 

Kushal_Chawda

@kaushi2020  try below

Sum({<Year={"$(=max(Year)-1)"} ProductName=p({1<Year={"$(=max(Year))"}>}ProductName)>} Sales)

Kushal_Chawda

@kaushi2020  It seems you need to sshow sales of previous year product to current year so try below

Sum({<Year={"$(=max(Year))"} ProductName=p({1<Year={"$(=max(Year)-1)"}>}ProductName)>} Sales)