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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Current Week - Previous Week Value

I want to calculate Growth, which is equal to Current two weeks data minus previous two weeks data, how can I achieve the same?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi

what does 'Latest week' represents ?  week  ?

My set analysis is based on days  not  WEEK !!!

=Sum( 1 {<DateField = {">=$(=Date(Today()-14,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}}Growth)



Will you post the sample qvw file , so that i can understand exact need ?

Sum(  {<WEEK = {">=$(=Date([Latest Week]-14,'MM/DD/YYYY'))<=$(=Date([Latest Week],'MM/DD/YYYY'))"}} TOTALAMOUNT)

View solution in original post

9 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Silambarasan1306
Creator III
Creator III

previous two weeks means previous year two weeks..????

Explain the question clearly braj..

Thanks

Anonymous
Not applicable
Author

For current two weeks

I am assuming current two weeks means next 2 weeks ?  (14 days)

=Sum({<DateField = {">=$(=Date(Today()+14,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} Growth)


Previous 2 weeks means  14 days ealier ?


=Sum({<DateField = {">=$(=Date(Today()-14,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} Growth)


or

like this ?

14 days ealier

=Sum({<DateField = {">=$(=Date(Today()-14,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} Growth)


28 days ealier

=Sum({<DateField = {">=$(=Date(Today()-28,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} Growth)

????

Regards

Allu

Not applicable
Author

Thanks Allu, it worked.

But when I applied Date filter, it gave me different value. How should I ignore the date filter?

Silambarasan1306
Creator III
Creator III

Nullify the date in set analysis.

Anonymous
Not applicable
Author

Hi

I am not sure about your query     : "How should I ignore the date filter?"

if you want the selection independent of SELECTION

14 days ealier

=Sum( 1 {<DateField = {">=$(=Date(Today()-14,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}}Growth)


28 days ealier

=Sum( 1 {<DateField = {">=$(=Date(Today()-28,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}}Growth)

Will you post the sample qvw file , so that i can understand exact need ?

Not applicable
Author

Thanks Allu, it worked.

But when I replaced today with my column name, it gave me blank. The expression I implemented is as below:

Sum(  {<WEEK = {">=$(=Date([Latest Week]-14,'MM/DD/YYYY'))<=$(=Date([Latest Week],'MM/DD/YYYY'))"}} TOTALAMOUNT)

Anonymous
Not applicable
Author

Hi

what does 'Latest week' represents ?  week  ?

My set analysis is based on days  not  WEEK !!!

=Sum( 1 {<DateField = {">=$(=Date(Today()-14,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}}Growth)



Will you post the sample qvw file , so that i can understand exact need ?

Sum(  {<WEEK = {">=$(=Date([Latest Week]-14,'MM/DD/YYYY'))<=$(=Date([Latest Week],'MM/DD/YYYY'))"}} TOTALAMOUNT)

Not applicable
Author

Thanks a lot...