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

Announcements
Discover the Trends Shaping AI in 2026: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Last Month

Hi,

I have this in my pivot:

sum({$<Mes={$(=Max(Mes)-1)},mes=>}If(Cod_Bloqueo <> 8, Deuda_Total))/Divisor

But doesn't work

Any help please Thanks

26 Replies
m_woolf
Master II
Master II

Try:

sum({$<Mes={"=$(=Max(Mes)-1)"},mes=>}If(Cod_Bloqueo <> 8, Deuda_Total))/Divisor

pover
Partner - Master
Partner - Master

You have to return the same format from the expression as the field Mes, and if the field Mes was created with the month() function you would have to try something like:

=sum({$<Month={'$(=month(makedate(max(Year),max(Month)-1)))'}>} [Sales Amount])

That and I'm curious why you have Mes and mes.

Karl

pgalvezt
Specialist
Specialist
Author

Thank you for your reply:

sum({$<Mes={"=$(=Max(Mes)-1)"},Mes=>}If(Cod_Bloqueo <> 8, Deuda_Total))/Divisor

Bring me the same result like Sum(If(Cod_Bloqueo <> 8, Deuda_Total)))/Divisor

Yes is Mes field Error Syntaxis.

But doesn't work

pgalvezt
Specialist
Specialist
Author

Pivot Table:

My Dimension is Period

My Formula is =Sum(If(Cod_Bloqueo <> 8, Deuda_Total)))/Divisor

How can I obtain the last month?

Thanks

pgalvezt
Specialist
Specialist
Author

Any Help?

m_woolf
Master II
Master II

Perhaps if you posted a sample qvw?

pgalvezt
Specialist
Specialist
Author

There goes thanks.

m_woolf
Master II
Master II

Your qvw doesn't contain any data.

pgalvezt
Specialist
Specialist
Author

I tried this:

sum({$<Mes={$(=Max(Mes)-1)}>}If(Cod_Bloqueo <> 8, Deuda_Total))/Divisor

But still doesn't work