Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
mslottje
Contributor II

Returning data of Friday on Monday

Hi Guys,

every morning I want to show my colleagues the sales of yesterday.

We're not open in the weekend, so on Monday I want to show the sales of the previous Friday.

Should I script this in my calendar? And if yes, what is the best way to do this?

Attached you'll find the script of my calendar.

Thanks in advance!

Cheers,

Mike

1 Solution

Accepted Solutions
Highlighted
vinieme12
Esteemed Contributor II

Re: Returning data of Friday on Monday

You should be modifying the expression like below

example

=if(num(WeekDay(Today()))= 0   /// Checking if today is Monday

, sum({<SalesDate = {"$(=DATE(Today()-3,'YOURDATEFORMAT'))"} >}Sales)   // Sales for Previous Friday

,else_your_existing_expression )

View solution in original post

5 Replies
Highlighted
vinieme12
Esteemed Contributor II

Re: Returning data of Friday on Monday

You should be modifying the expression like below

example

=if(num(WeekDay(Today()))= 0   /// Checking if today is Monday

, sum({<SalesDate = {"$(=DATE(Today()-3,'YOURDATEFORMAT'))"} >}Sales)   // Sales for Previous Friday

,else_your_existing_expression )

View solution in original post

Highlighted
Partner
Partner

Re: Returning data of Friday on Monday

First load your data in App.

Sales:

LOAD * FROM SalesData.qvd;

//Then calculate maximum date of your data.

MaxDate:

LOAD max(Date) as MaximumDate

Resident Sales;


LET varMaxDate = num(peek('MaximumDate',0,'MaxDate'));

This should solv your problem.

Highlighted
mslottje
Contributor II

Re: Returning data of Friday on Monday

That worked perfectly in the expression of my chart, awesome!

Thanks a lot Vineeth

Highlighted
mslottje
Contributor II

Re: Returning data of Friday on Monday

I persume I'll have to do this in my calendar script in my loading script Shubham?:)

Highlighted
Partner
Partner

Re: Returning data of Friday on Monday

Yes