Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
sunny_talwar

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'))"}>}

fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

You can generate it in script:

DATA:

LOAD

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

AutoGenerate 7;

Saludos.

Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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

This was it!?

#Qlikisdarkandfulloftricks

Anonymous
Not applicable
Author

But im not getting the calculated dimension in Number tab

sunny_talwar

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?

Anonymous
Not applicable
Author

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

lorenzoconforti
Specialist II
Specialist II

Maybe:

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