Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
frantzgnz
Contributor III
Contributor III

Current Month vs Previous Month Value

Hi!

I want to compare Current Month Value vs Previous Month Value. I made a question 2 days ago for a Current Month vs Previous Month Total Tickets : Get how many tickets were generated in the month before the chosen one

I did that. I created a 2 news fields:

Month(Fecha_Crea) as FechaMonth,

Num(Month(Fecha_Crea)) as Num_Fecha,



Now, I have to compare a different field: 'SLA'. To get SLA, I have this expression:

Count({$<Cumplimiento={'CUMPLIÓ'}>} Ticket)/Count(TOTAL Ticket) . It shows me SLA of Current Month

Now, I want to get a SLA of Previous Month. I did this:

Count({< Num_Fecha = {  $(=Max(Num_Fecha) - 1)}>+$<Cumplimiento={'CUMPLIÓ'},[Fecha_Crea.autoCalendar.Month]>}Ticket)/Count(TOTAL Ticket)

But it doesn't work.

My expression to get a Current Month Total Tickets is :

Count({  < Num_Fecha = {  $(=Max(Num_Fecha) - 1)},[Fecha_Crea.autoCalendar.Month] >}Ticket)


I hope u can help me.

Thanks

1 Solution

Accepted Solutions
francescoreggia
Partner - Contributor III
Partner - Contributor III

Sorry


Count({< Num_Fecha = {  $(=Max(Num_Fecha) - 1)},Cumplimiento={'CUMPLIÓ'},[Fecha_Crea.autoCalendar.Month]>}Ticket) /

Count(TOTAL {< Num_Fecha = {  $(=Max(Num_Fecha) - 1)},[Fecha_Crea.autoCalendar.Month]>} Ticket)

View solution in original post

5 Replies
francescoreggia
Partner - Contributor III
Partner - Contributor III

Try

Count({< Num_Fecha = {  $(=Max(Num_Fecha) - 1)},Cumplimiento={'CUMPLIÓ'},[Fecha_Crea.autoCalendar.Month]>}Ticket)/Count(TOTAL Ticket)

frantzgnz
Contributor III
Contributor III
Author

It shows me a wrong number 😕

MarioCenteno
Creator III
Creator III

Hi @Frantz Gonzales

You could try something like that:

Count({$<[Cumplimiento]={'CUMPLIO'},[Fecha_crea.autoCalendar.Date]=

{'>=$(=AddMonths(MonthStart(Today()),-2))<=$(=AddMonths(MonthEnd (Today()),-2))'}>}Ticket/Count(TOTAL Ticket)

Mario Centeno

francescoreggia
Partner - Contributor III
Partner - Contributor III

Sorry


Count({< Num_Fecha = {  $(=Max(Num_Fecha) - 1)},Cumplimiento={'CUMPLIÓ'},[Fecha_Crea.autoCalendar.Month]>}Ticket) /

Count(TOTAL {< Num_Fecha = {  $(=Max(Num_Fecha) - 1)},[Fecha_Crea.autoCalendar.Month]>} Ticket)

frantzgnz
Contributor III
Contributor III
Author

It works ! Thanks!