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

Set Analysis based on Dimension

Hello!

I am trying to build a table with the following format

 

YEAR_MONTH SALES LAST_YEAR_SALES
OUT 2021 60 40
NOV 2021 50 30
DEC 2021 20 40
JAN 2022 10 10

 

Where "YEAR_MONTH" is a dimension and SALES is SUM(SALES)

How do i create the "Last Year Sales" columns? I think i would need to perform some kind of set analysis based on the table's dimension. How could i do that, knowing that YEAR_MONTH is a string?

1 Reply
tm_burgers
Creator III
Creator III

I think firstly you need to add the date field in the data - convert the string into a date. 

 

Date(Date#(YEAR_MONTH,'MMM YYYY')) as SalesDate