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

Compare data from two periods

Hi,

Untitled.png

I'm having problems trying to compare the data from two different time periods. I know there are already many similar topics, but I just can't solve it.

I would like to see comparatively newer and older data on one graph, but only the dimension of newer data.

Not like this on photo, that there is just one graph.

 

 

 

Labels (3)
1 Solution

Accepted Solutions
EdgarOlmos
Contributor III
Contributor III

You can concatenate both tables.
Using GraphicYearMonth as dimension and applying set analysis to make two metrics, you can do it using the field origen (Sum({$<Origen = {'SALES'}> }JobOrderQuantity_KG)).

Regards

 

SALES:
LOAD 'SALES' as Origen,
"ProfitCenter"
,"ItemCategoryCode"
,"JobOrderQuantity_KG"
,Dual(num(Month(DeliveryDate)) & ' / ' & Year(DeliveryDate),year(DeliveryDate) & num(month(DeliveryDate), '00')) as YearMonth
,num(Month(DeliveryDate),'00') & ' / ' & Year(DeliveryDate) as GraphicYearMonth
from [$(DataFolderName)/SALES.qvd] (qvd)
where
DeliveryDate >= Date(MonthStart(Today(), -5))
;

Concatenate

LOAD 'LAST_YEAR' as Origen,
"ProfitCenter"
,"ItemCategoryCode"
,"JobOrderQuantity_KG"
,Dual(num(Month(DeliveryDate)) & ' / ' & Year(DeliveryDate),year(DeliveryDate) & num(month(DeliveryDate), '00')) as YearMonth2
,num(Month(DeliveryDate),'00') & ' / ' & (Year(DeliveryDate)+1) as GraphicYearMonth
from [$(DataFolderName)/SALES.qvd] (qvd)
where
DeliveryDate >= Date(MonthStart(Today(), -17))
and DeliveryDate < Date(MonthStart(Today(), -5))

 

 

 

View solution in original post

2 Replies
Dalton_Ruer
Support
Support

You can accomplish COMPARISONS between time periods using SET ANALYSIS. If you are not familiar with set analysis, I created a post years ago that is a hands on workshop. You can download a PDF of the exercises that leads you through it and an application that has the data for the exercises. 

 

https://community.qlik.com/t5/Official-Support-Articles/Hands-on-Set-Analysis-from-the-ground-up/ta-...

 

 

EdgarOlmos
Contributor III
Contributor III

You can concatenate both tables.
Using GraphicYearMonth as dimension and applying set analysis to make two metrics, you can do it using the field origen (Sum({$<Origen = {'SALES'}> }JobOrderQuantity_KG)).

Regards

 

SALES:
LOAD 'SALES' as Origen,
"ProfitCenter"
,"ItemCategoryCode"
,"JobOrderQuantity_KG"
,Dual(num(Month(DeliveryDate)) & ' / ' & Year(DeliveryDate),year(DeliveryDate) & num(month(DeliveryDate), '00')) as YearMonth
,num(Month(DeliveryDate),'00') & ' / ' & Year(DeliveryDate) as GraphicYearMonth
from [$(DataFolderName)/SALES.qvd] (qvd)
where
DeliveryDate >= Date(MonthStart(Today(), -5))
;

Concatenate

LOAD 'LAST_YEAR' as Origen,
"ProfitCenter"
,"ItemCategoryCode"
,"JobOrderQuantity_KG"
,Dual(num(Month(DeliveryDate)) & ' / ' & Year(DeliveryDate),year(DeliveryDate) & num(month(DeliveryDate), '00')) as YearMonth2
,num(Month(DeliveryDate),'00') & ' / ' & (Year(DeliveryDate)+1) as GraphicYearMonth
from [$(DataFolderName)/SALES.qvd] (qvd)
where
DeliveryDate >= Date(MonthStart(Today(), -17))
and DeliveryDate < Date(MonthStart(Today(), -5))