Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Show last 7 days of calendar year in a table as dimension

Hi All,

Is it possible to show the last 7 days of calendar year in a table as dimension?

As of today it show

10/13/2017

10/14/2017

10/15/2017

10/16/2017

10/17/2017

10/18/2017

10/19/2017

I don't have separate date field for this.

Thanks

Anupama Jagan

9 Replies
Highlighted

Re: Show last 7 days of calendar year in a table as dimension

table as in straight table? What is your expression? You can add a set analysis to all you expression to view the last 7 days

{<Date = {"$(='>=' & Date(Today() - 7, 'MM/DD/YYYY') & '<=' & Date(Today(), 'MM/DD/YYYY'))"}>}

Highlighted
Partner
Partner

Re: Show last 7 days of calendar year in a table as dimension

Hi,

You can generate it in script:

DATA:

LOAD

  Date(Today() - 1 + Rowno()) as "Dimension"

AutoGenerate 7;

Saludos.

Highlighted
Creator
Creator

Re: Show last 7 days of calendar year in a table as dimension

But only when we add it as a dimension we will get date displayed right?

Actually this is my orginal req:

Date - to show last 7 days(calendar dates to be populated)

Approved (metric) - sum (Approved) based on Approveddate

Total(metric) - sum (Total) based on TotalDate

Date sum(Approved)sum(Total)
10/13/20172061
10/14/20173062
10/15/20172581
10/16/20171673
10/17/20171878
10/18/20171991
10/19/20172162
Highlighted
Creator
Creator

Re: Show last 7 days of calendar year in a table as dimension

You can use an if in the dimension tab directly (not the script nor the expressions). Just add a calculated dimension in the chart and write this down:

=ValueLoop(today()-7,today(),1)

This give you the seven last days in num format.. can't come to how to pass it do date :/, but it 's close

Highlighted
Creator
Creator

Re: Show last 7 days of calendar year in a table as dimension

Got it!!!! Go to the number tab and select date format

This was it!?

#Qlikisdarkandfulloftricks

Highlighted
Creator
Creator

Re: Show last 7 days of calendar year in a table as dimension

But im not getting the calculated dimension in Number tab

Highlighted

Re: Show last 7 days of calendar year in a table as dimension

But only when we add it as a dimension we will get date displayed right?

Not sure I understand your question? How does the raw data look for the output you have provided?

Highlighted
Creator
Creator

Re: Show last 7 days of calendar year in a table as dimension

True! Sorry i was doing it from List box object. I will investigate

Highlighted
Specialist II
Specialist II

Re: Show last 7 days of calendar year in a table as dimension

Maybe:

=Date(ValueLoop(today()-7,today(),1) ,'DD/MM/YYYY')