# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor

## Previous month vs Current Month in Qlik sense

Hi Qlikers,

I wanted to show line Chart  for Previous month and current month for dimension :Month-> Day

Expression for current month

=sum({<type={'Order'},FiscalYear={\$(=max(FiscalYear))}>} Sales)

Current Month works fine

Expression for Previous month

=sum({<type={'Order'},FiscalYear={\$(=max(FiscalYear))},MonthID={\$(=max(MonthID)-1)}>} Sales)

It Showing Wrong output

Can anyone help me?

Tags (2)
11 Replies
MVP

## Re: Previous month vs Current Month in Qlik sense

If you have Month as Dimension, then you have to keep in mind that in QlikView Set Analysis, Set Expression will evaluate once only per chart..

MVP

## Re: Previous month vs Current Month in Qlik sense

Don't you think, Current month should like this?

sum({<type={'Order'},FiscalYear={"\$(=max(FiscalYear))"},MonthID={"\$(=max(MonthID))"}>} Sales)

MVP

## Re: Previous month vs Current Month in Qlik sense

for previous try this

=above(sum({<type={'Order'},FiscalYear={"\$(=max(FiscalYear))"}>} Sales),0,rowno())

Contributor

## Re: Previous month vs Current Month in Qlik sense

Thank you Kushal Chawda

Sorry it didn't work

MVP

## Re: Previous month vs Current Month in Qlik sense

Would you be able to share a sample?

Contributor

## Re: Previous month vs Current Month in Qlik sense

It may be look like it

Contributor II

## Re: Previous month vs Current Month in Qlik sense

Better u can use "above" function to get the data's of previous month.

Contributor III

## Re: Previous month vs Current Month in Qlik sense

Hi,

Use above function : (above(sum({<type={'Order'},FiscalYear={"\$(=max(FiscalYear))"}>} Sales))

and set previous year max month in the variable then use that variable in null values in the column.

Honored Contributor II

## Re: Previous month vs Current Month in Qlik sense

Hi Scotly,

In our master calendar, make use of inMonth() and InMonthToDate() function to set flags and make use of these flags in set analysis.

This will even improve the performance.

Thanks,

Sangram.