Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
ilanbaruch
Contributor III

addmonths previous 30 days

hi all ,

i have a line chart with one expression that retrieve count value for every day.

i want to add an expression to count same value for the previous 30 days / 1 month

any ideas?

dimension is date DD-MMM-YY

first expression  : Count({<invoice_count={1}>+<order_count={1},MM=>} DISTINCT client_id)

3 Replies
MVP & Luminary
MVP & Luminary

Re: addmonths previous 30 days

HI,

Try like this

=Count({<invoice_count={1}, MM=, DateFieldName={''>=$(=AddMonths(Max(DateFieldName), -1))<=$(=Date(Max(Date)))'}>+<order_count={1},MM=, DateFieldName={''>=$(=AddMonths(Max(DateFieldName), -1))<=$(=Date(Max(Date)))'}>} DISTINCT client_id)


Regards,

jagan.

balrajahlawat
Esteemed Contributor

Re: addmonths previous 30 days

Re: addmonths previous 30 days

Hi,

Change DateField according to your application.

Count({<DateField={">=$(=Date(monthstart(addmonths(Max(DateField),-1)),'DD-MMM-YYYY'))<=$(=Date(Monthend(addmonths(Max(DateField),-1)),'DD-MMM-YYYY'))"},invoice_count={1}>

      +

  <DateField={">=$(=Date(monthstart(addmonths(Max(DateField),-1)),'DD-MMM-YYYY'))     <=$(=Date(Monthend(addmonths(Max(DateField),-1)),'DD-MMM-YYYY'))"},

     order_count={1},MM=>} DISTINCT client_id)