Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
kailashkotak91
New Contributor III

Getting difference between current month and previous month in straight table

Hi Qlik Experts,

I need the difference between the count of EP for march 2018 and feb 2018. The month field is already coming from my database. how can i write an expression in the straight table to achieve this ?

 

Thanks in advance

 

2 Replies
y_grynechko
New Contributor III

Re: Getting difference between current month and previous month in straight table

Hey,

it depends how you get the data. Do you get some additional data fields from which Month is being generated? Or you just have plain text months provided in one column? 

 

Shubham_Deshmukh
Valued Contributor

Re: Getting difference between current month and previous month in straight table

In your data,  you have direct months only  in DB OR you are generating month from date field.

1.  If you have direct month data and if sequence is proper, then use this : 

=If(RowNo() = 1, 0,[EP Scanned]  - Above([EP Scanned]]))

2. If you have date field in data then extract that field and use this: 

=sum(if(dates>=MonthStart(today()) and dates <=MonthEnd(today()),[EP Scanned]  ))
-
sum(if(dates>=MonthStart(Addmonths(today(),-1)) and dates <=MonthEnd(Addmonths(today(),-1)),[EP Scanned]  ))

 

Regards

Shubham