Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

jim_chan
Contributor III

How to write a previous month set analysis??

Hi guys,

i want to look for a previous month count. here my set analysis.

Count({$< Channel= {'TV1'}, Month(addmonths(max(master_date) ,- 1))}>}ID)

I think my set analysis is wrong.. i couldnt get any result. please help@!

Rgds

Jim

7 Replies
prahlad_infy
Contributor

Re: How to write a previous month set analysis??

vMonth= (Month(Addsmonth(Today(),-1))

<Channel= {'TV1'}, Month_Field={'$(vMonth)'}>

jim_chan
Contributor III

Re: How to write a previous month set analysis??

i have added this

count(<Channel= {'TV1'}, month={'$(vMonth)'}>ID)

but stil not working.

prahlad_infy
Contributor

Re: How to write a previous month set analysis??

send me sample data

Highlighted
arvind1494
Valued Contributor

Re: How to write a previous month set analysis??

Count({< Channel= {'TV1'},Month_Field= {$(=max(Month_Field)-1)}>}ID)

Partner
Partner

Re: How to write a previous month set analysis??

Add equation before expression:

vMonth= '=Month(AddMonths(Max(master_date),-1)'

sasiparupudi1
Honored Contributor III

Re: How to write a previous month set analysis??

You have to have a month period field .. Could you pl share a sample?

ex: if you have a filed that is in  NOV 2018  format,

=count({<Channel= {'TV1'},MonthYear={"$(=Date(AddMonths(Today(),-1),'MMM YYYY'))"}>} ID)

sergioskv
New Contributor III

Re: How to write a previous month set analysis??

Hi!

Try this:

Count({$<Channel= {'TV1'},Master_date={">=$(=Addmonths(min(Master_date),-1))<=$(=Addmonths(max(Master_date),-1))"}>}ID)

Skvortsov S.