Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
khanashique
Contributor II

Last 7 Days values

Hi Experts,

Below is the table, from which i need to prepare a chart, that will show only last 7 days data/value. 

ItemDateValue
Books10-Nov-183021.15
Books11-Nov-183482.1
Books12-Nov-182194.25
Books13-Nov-181992.7
Books14-Nov-181036.75
Books15-Nov-182785.45
Books16-Nov-182258.7
Books17-Nov-182355.2
Books18-Nov-181879.9
Pen19-Nov-181313.4
Pen20-Nov-183146.05
Pen21-Nov-181246.75
Pen22-Nov-181371.8
Pen23-Nov-182538.9
Pen24-Nov-182344.25
Pen25-Nov-182598.15
Pen26-Nov-182415.85
Pen27-Nov-182292.95
Pen28-Nov-181255.85
Cover29-Nov-180
Cover30-Nov-180
Cover1-Dec-18999.5
Cover2-Dec-183882.45
Cover3-Dec-181550.7
Cover4-Dec-181650.75
Cover5-Dec-184218.3
Pencil6-Dec-189519.75
Pencil7-Dec-187942.7
Pencil8-Dec-183665.6
Pencil9-Dec-183655.8
Pencil10-Dec-1810833.25

Thanks,

MAK.

 

Labels (3)
1 Solution

Accepted Solutions
adamgaox
Contributor

Re: Last 7 Days values

Sorry, didn't notice you're sense user.

Please try the zip qvf file.

Dimension:

=If(Date>$(MaxDayMinus7),Date(Date,'dd-MMM-YYYY')&chr(13)&Item,NULL())

 

Variable MaxDayMinus7:

=Max(Num(Date))-7

捕获.PNG

 

6 Replies
khanashique
Contributor II

Re: Last 7 Days values

Need a chart which will show data like shown below:

Capture.JPG

adamgaox
Contributor

Re: Last 7 Days values

Hope u like QlikView.

I'm a big fan.

:smileyhappy:

mark6505
Valued Contributor III

Re: Last 7 Days values

Hi,
I would add a flag to the data in script and use that.
IF(TempDate <= TODAY(1) AND TempDate >= (TODAY(1)-7),1) AS F_ROLLING_7,

Then Set Analysis would be
SUM({<F_ROLLING_7={1}>}Value)

Mark
Gabriel
Valued Contributor III

Re: Last 7 Days values

Hi,

 

Try this expression

=SUM({<Date = {"<=$(=MAX(Date))>=$(=Date(MAX(Date)-7))"}>}Value)

adamgaox
Contributor

Re: Last 7 Days values

Sorry, didn't notice you're sense user.

Please try the zip qvf file.

Dimension:

=If(Date>$(MaxDayMinus7),Date(Date,'dd-MMM-YYYY')&chr(13)&Item,NULL())

 

Variable MaxDayMinus7:

=Max(Num(Date))-7

捕获.PNG

 

khanashique
Contributor II

Re: Last 7 Days values

Thanks a lot Adam...