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

Calculating Previous Quarter from different Source

Hi QV Members,

I was stuck at a point where we need to calculate the share change ie Current quarter - previous quarter. We have 2 different tables:

1) First table contains only the latest quarter data for each specific Plan (ex: one plan contains data for Q3'15 other plan may contain data for Q2'15) the quarter for each plan may be different. We are showing Plan - Quater and market share.

2) Second table contains 4 quarters of data for each Plan. (As shown in the below excel)

Now we need to calculate share change, so our requirement is we need to show plan -quarter and market share from first table and while calculating share change we need to find Latest Quarter for each plan from the first table and need to calculate Previous quarter (Max quarter from first table-1) from the second table and need to do Current qtr sales- Previous qtr sales.

There may be a multiple approaches for this but it would be great if any one help me at data model level by doing some mapping or any other methods.

Thanks in Advance

Table 1:                                     

PlanQuarterSales
Plan 1Q3'1434
Plan 2Q2'1423
Plan 3Q1'14213

Table 2:

Plan 1Q3'1434
Plan 1Q2'1424
Plan 1Q1'1454
Plan 1Q4'13143
Plan 2Q2'1443
Plan 2Q1'1454
Plan 2Q4'1345
Plan 2Q3'1324
Plan 3Q1'1445
Plan 3Q4'1343
Plan 3Q3'1367
Plan 3Q2'13567
0 Replies