Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
kseniyav
New Contributor II

Calculate vs last month. Months as numbers

Hi, may be somebody can help me

Now I have the date, which I divided on Year, Month, date.

The part of my script is here: 

DATE ( "Дата поступления претензии") AS Date,

Month ( "Дата поступления претензии") AS Month,

Year ( "Дата поступления претензии") AS Year,

Currently I have Months as the names (Jan, Feb, Mar....).

The aim - I want to calculate metrics versus last month

for ex: to clik  in filters: 2018 Jun   and have metric for automatic calculation vs previous month (in this case it is 2018 May)

But I can't do it.

How I can add the new column with month as numbers (1, 2, 3, 4...12) and apply Max\Min (Month) function ?

Or may be you know another decision?

my formula: Count([Numbers of complaints])/Sum({<[Source of claim]=>}ktn)

P.S: for calculation vs full last year work this:

(Count({$<Year={"$(=Max(Year))"}>}[Numbers of complaints])/Sum({$<Year={"$(=Max(Year))"},[Source of claim]=>}ktn))-

(Count({$<Year={"$(=Max(Year)-1)"},Month=>}[Numbers of complaints])/Sum({$<Year={"$(=Max(Year)-1)"},[Source of claim]=, Month=>}ktn))

2 Replies

Re: Calculate vs last month. Months as numbers

To trasfer month names to month numbers, you need

Num(Month ( "Дата поступления претензии")) AS MonthNum


Then, call

Max(MonthNum) as maxmonth,

Min(MonthNum) as minmonth


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)
kseniyav
New Contributor II

Re: Calculate vs last month. Months as numbers

Thanks a lot!!!!!