Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

satishkamath
Contributor II

Subtract Previous month value from Present month value

Hi All

Base on MonthYear selection(on Left) I want to see the Selected Month Value - Previous Month Value for Selected Month

So let see below two scenario

Scenario 1: Jun-2012

Scenario 2: Juj-2012

In case of Scenario 2(if I Select Jul-2012) I want to show for each and every cell

1. ▲(alt + 30) if(Jul-2012 > Jun-2012)  OR

2. ▼(alt + 31) if(Jul-2012 < Jun-2012)

3. else Blank

Note: test.qvw attached

Thanks in advance

1 Solution

Accepted Solutions

Re: Subtract Previous month value from Present month value

I believe this expression accomplishes what you're asking:

if(

/* Selected Month */ sum(InvoiceValue) -

/* Previous Month */ sum({<MonthYear={$(=chr(39) & date(AddMonths(MonthYear, -1), 'MMM-YYYY') & chr(39))}>}InvoiceValue)

  > 0, '▲',

if(

/* Selected Month */ sum(InvoiceValue) -

/* Previous Month */ sum({<MonthYear={$(=chr(39) & date(AddMonths(MonthYear, -1), 'MMM-YYYY') & chr(39))}>}InvoiceValue)

  < 0, '▼'

, ''))

I've also attached your test file with this expression included.

3 Replies

Re: Subtract Previous month value from Present month value

I believe this expression accomplishes what you're asking:

if(

/* Selected Month */ sum(InvoiceValue) -

/* Previous Month */ sum({<MonthYear={$(=chr(39) & date(AddMonths(MonthYear, -1), 'MMM-YYYY') & chr(39))}>}InvoiceValue)

  > 0, '▲',

if(

/* Selected Month */ sum(InvoiceValue) -

/* Previous Month */ sum({<MonthYear={$(=chr(39) & date(AddMonths(MonthYear, -1), 'MMM-YYYY') & chr(39))}>}InvoiceValue)

  < 0, '▼'

, ''))

I've also attached your test file with this expression included.

satishkamath
Contributor II

Re: Subtract Previous month value from Present month value

Hi Nicole

I do not see attachment.

Thanks

satishkamath
Contributor II

Re: Subtract Previous month value from Present month value

Thanks Nicole

I appreciate your correct answer

Community Browser