Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
b_zumdick
New Contributor

Comparison of periods

Hello,

I would like to compare the sales of a selected period (for example, Oct. 2018 to April 2019) with the sales of the same period 1 year before, 2 years before and 3 years before. All the 4 sales values should be created as key figures (master elements). With which function can I create these key figures?

Can anybody help me?
Thank you in advance!

Tags (2)
1 Reply

Re: Comparison of periods

Perhaps this?

If(MonthName>=AddYears(Min(MonthName),-1) and MonthName<=AddYears(Max(MonthName),-1), '1 Year Before',

If(MonthName>=AddYears(Min(MonthName),-2) and MonthName<=AddYears(Max(MonthName),-2), '2 Year Before',

If(MonthName>=AddYears(Min(MonthName),-3) and MonthName<=AddYears(Max(MonthName),-3), '3 Year Before', 'More than 3 Year')))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)