Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
evansabres
Valued Contributor

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
Highlighted
trdandamudi
Honored Contributor II

Re: Past 7 Days Sales

Give a try on the below:

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

View solution in original post

2 Replies
Highlighted
trdandamudi
Honored Contributor II

Re: Past 7 Days Sales

Give a try on the below:

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

View solution in original post

neelamsaroha157
Valued Contributor II

Re: Past 7 Days Sales

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.