Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Past 7 Days Sales

I am looking to create an expression to produce a result of sales over the past 7 says for a particular buyer type

 

Date field is called 'TRANSDATE'

Sales field is called 'QTY'

Buyer Type Field is Called 'BUYERTYPE' and the particular value is 'ADULT'

I have the following which I believe should work, but not positive and I need to introduce the other qualifier of BUYERTYPE = ADULT. How do I need to structure this expression?

=SUM({<[TRANSDATE]={"$(=date(max([TRANDATE)-7"}>}QTY)

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

Give a try on the below:

=SUM({<BUYERTYPE={'ADULT'},TRANSDATE={"$(=Date(Max(TRANDATE)-7))"}>}QTY)

View solution in original post

2 Replies
trdandamudi
Master II
Master II

Give a try on the below:

=SUM({<BUYERTYPE={'ADULT'},TRANSDATE={"$(=Date(Max(TRANDATE)-7))"}>}QTY)

neelamsaroha157
Specialist II
Specialist II

Try this - 

Sum({$<BUYERTYPE = {'ADULT'},TRANDATE={">=$(=(Max(TRANDATE)-7))<=$(=Max(TRANDATE))"}>}QTY)

 

[TRANSDATE]={"$(=date(max([TRANDATE)-7"} will give you data for only last 7th day not all 7 days.