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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
iahmadmca1
Contributor III
Contributor III

Count the date for 7 rolling days.

Team,

I am using the expression for count the 7 rolling days.so I request to everyone please suggest me to do the 7 rolling days.

Please find the below expression and make it 7 rolling days.based on file date.

=num(If(AMPM='AM',

  Only({<AMPM = {PM}>} TOTAL<[TGB Name], f_date> Counts) /Only({<AMPM = {AM}>} TOTAL<  [AMI TGB ID]> Counts)-1,

  Only({<AMPM = {AM}>} TOTAL<[TGB Name],f_date> Counts)/ Only({<AMPM = {PM}>} TOTAL< [AMI TGB ID]> Counts) -1

),'#.##%')

Thanks,

Irshad Ahmad

7 Replies
Anil_Babu_Samineni

You can use like below

Count({<Date={‘>=$(=Date(Max(DateField)-7))<=$(=Date(Max(DateField)))’}>} Measure)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
hariprasadqv
Creator III
Creator III

Try Rangesum() with above() for last 7 records. It will work.

iahmadmca1
Contributor III
Contributor III
Author

Thanks Anil for the reply.

iahmadmca1
Contributor III
Contributor III
Author

Thanks Hari for the reply.

iahmadmca1
Contributor III
Contributor III
Author

Hi Anil,

could you please use my expression which I post and make it correct because I try to use the expression which you have sent but is showing error.please correct of my expression based 7 days rolling.

Thanks,

Irshad Ahmad

Anil_Babu_Samineni

May be like this?

=Num(Count({<Date={‘>=$(=Date(Max(DateField)-7))<=$(=Date(Max(DateField)))’}>} If(AMPM='AM',

  Only({<AMPM = {PM}>} TOTAL<[TGB Name], f_date> Counts) /Only({<AMPM = {AM}>} TOTAL<  [AMI TGB ID]> Counts)-1,

  Only({<AMPM = {AM}>} TOTAL<[TGB Name],f_date> Counts)/ Only({<AMPM = {PM}>} TOTAL< [AMI TGB ID]> Counts) -1

), Measure),'#.##%')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
iahmadmca1
Contributor III
Contributor III
Author

Thank you Anil !