Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

Year-1 / Month -1

Hello Guys,

I hope all is good.

I need to get the value of month -1 (of the selected month), YEAR-1 of the expression bellow :


=num(sum( [Active Base] )  ,'# ##0')

My fields are month of date, year of date

Thanks a lot

Labels (1)
11 Replies
zhadrakas
Specialist II
Specialist II

Hello,

try like this

num(Sum({$<Year={"=max(Year)-1"}, Month={"=max(Month)-1"}>}[Active Base]) , '# ##0')

regards

tim

prma7799
Master III
Master III

Try like this

=Num(Sum({$<[Posting Date]={"=max(Year([Posting Date]))-1"}, [Posting Date]={"=max(Month([Posting Date]))-1"}>}[Gross Sales Amount]) , '###0')

techvarun
Specialist II
Specialist II

Num((sum({<[month of date]={$(=Month(TODAY())-1)}>} [Active Base]) + sum({<[Year of date]={$(=Month(TODAY())-1)}>} [Active Base])),'# ##0')

its_anandrjs
Champion III
Champion III

Try this way in Month use the Datefield

=num(sum( {<Year={"$(=Max(Year)-1)"}, Month={"$(=Max(Month(DateField))-1)"} >} [Active Base] )  ,'# ##0')

its_anandrjs
Champion III
Champion III

One question how many date fields you have.

Anil_Babu_Samineni
MVP
MVP

This one works, but you need top assign dollar symbol

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni
MVP
MVP

You can't write like this, because Set analysis explorer miffed with only one field for one time.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
prma7799
Master III
Master III

Hi Anil,

I appreciate your suggestion but could you please explain more. I didn't understand ...

Thanks 

Anil_Babu_Samineni
MVP
MVP

The thing is simple, you added [posting Date] as 2 times In the left hand side of degrade expression. That means qlikview doesn't capture for which option need to calculate so the only option is either used year and month calculation from field called date field. Does it likable?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful