Knowledgebase: Tips and Tricks
QlikView App: Set Analysis - Prior Period Comparison
Posted by Tier1 Support on 20 April 2016 08:49 PM

This QlikView shows how basic Set Analysis syntax can be used to deliver a Prior Period Comparison.

If you want to copy and paste the table from this example into another document you can set all the variables by adding this code to your load script:


let vMaxDate  = '=max(Date)';

let vMaxDay   = '=day(max(Date))';

let vMaxMonth  = '=month(max(Date))';

let vMaxYear  = '=max(Year)';

let vPriorMonth  = '=month(addmonths(max(Date),-1))';

let vPriorMonthYear = '=Year(addmonths(max(Date),-1))';

let vPriorYear  = '=vMaxYear-1';

let vPriorYearDate = '=date(addyears(max(Date),-1),' & chr(39) & 'DD MMM YYYY' & chr(39) & ')';


Obviously you will need to change the field names to match the date fields in your data model.

 PriorPeriodComparison.qvw (179.50 KB)
(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).