Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Display comparative data for this time last year

Hello,

I've done a lot of reading about how to bring previous year's data into a column for comparison against current year data.   I've explored the use of variables within SET ANALYSIS but am not getting reliable results.  mostly I get 0 or NULL fill.

The attached example has 2012-13 and 2013-14 Financial Year data.  in Australia our Financial year starts in July and ends in June.

I simply want to display the sum of a field for the currently selected year (ie: 2013-14), then have the previous year field display the same time period (days and months) for the previous year (ie 2012-13).  I can achieve this by hard coding '2012-13' into the SET ANALYSIS but that is very restrictive - and not in the true spirit of QV.

I've explored using variables to calculate currentdate - 365 but this only produces results where a single day is selected. 

If anyone has the time to take a look and make some recommendations it would be greatly appreciated.

Regards,

John.

1 Solution

Accepted Solutions
Not applicable
Author

Hi John,

The set analysis that you are looking for is below

 

SUM

({$<TASPriceWeightSameDayFlag={'Overnight'},AcuteSubacuteFlag={'Acute'},FinancialYear={'$(=MaxString(PreviousFinancialYear))'}>} TASPriceWeight)

Try this.

Best regards,

Gowri Shankar

View solution in original post

1 Reply
Not applicable
Author

Hi John,

The set analysis that you are looking for is below

 

SUM

({$<TASPriceWeightSameDayFlag={'Overnight'},AcuteSubacuteFlag={'Acute'},FinancialYear={'$(=MaxString(PreviousFinancialYear))'}>} TASPriceWeight)

Try this.

Best regards,

Gowri Shankar