Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
venkat1
Creator II
Creator II

How to show yesterday sales in the pivot table ?

Hi ,

I am trying this expression but it was not getting correctly , how to show yesterday sales ?

=Sum(Fabs({<VOU_DATE={"$(=Max(VOU_DATE)-1)}>}G.NET_WT))

1 Solution

Accepted Solutions
venkat1
Creator II
Creator II
Author

i tried this, this was working as per expected.

 

=Sum({<VOU_DATE= {"$(=Date(Floor(Max(VOU_DATE)-1),'DD-MMM-YYYY'))"}>}fabs( G.NET_WT))

View solution in original post

5 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Try this:

=sum({<VOU_DATE= {"$(=Date(Floor(Max(VOU_DATE)-1)))"}>} NET_WT)

amrinder
Creator
Creator

Hey,

Max(VOU_DATE)-1)  will return yesterday's date but it will be in Number format. Make sure to define it in date format similar to VOU_DATE format.

For example:

Sum(Fabs({<VOU_DATE={"$(=Date(Max(VOU_DATE)-1),'DD/MM/YYYY')}>}G.NET_WT))

Hope it helps.

-amrinder

venkat1
Creator II
Creator II
Author

Hi,

if i keep fabs then it was throwing error in script.

=sum(fabs({<VOU_DATE= {"$(=Date(Floor(Max(VOU_DATE)-1),'DD-MMM-YYYY'))"}>} G.NET_WT))

i need to give fabs in the expression.

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I am not sure why you are using Fabs but in case you really need it use it in the Set analysis:

=sum({<VOU_DATE= {"$(=Date(Fabs(Floor(Max(VOU_DATE)-1),'DD-MMM-YYYY')))"}>} G.NET_WT)

venkat1
Creator II
Creator II
Author

i tried this, this was working as per expected.

 

=Sum({<VOU_DATE= {"$(=Date(Floor(Max(VOU_DATE)-1),'DD-MMM-YYYY'))"}>}fabs( G.NET_WT))