Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tresesco
MVP
MVP

Previous day sales

Hello Everybody,

It looks pretty easy, but even after exploiting the head for quite a long time i could not figure out. Sure that experts here would be able to help.

CompanyDateSales for the dayPreviousDaySales
A27-08-2013SUM(Sales)Sum( Sales as on 25th)
A25-08-2013SUM(Sales)Sum( Sales as on 19th)
A19-08-2013SUM(Sales)Sum( Sales as on the day sales took place before 19th)

Have attached a qvw, please have a look.

Note: I don't want to use BELOW() function, neither I want to achieve this in the script(AsOfDate approach i am aware of). Please suggest an expression, might be using set analysis with functions like , AGGR, RANK, FIRSTSORTEDVALUE.

Thanks a lot.

10 Replies
MayilVahanan

Hi

PFA

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tresesco
MVP
MVP
Author

Thanks Mayil+Vahanan Ramasamy for the reply. However, as i mentioned earlier, i am looking for a front end solution .

MayilVahanan

HI tresesco,

I think its difficult process to achieve this. Can you able to say why you goes for front end solution, instead of backend or below function?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tresesco
MVP
MVP
Author

Hi Ramasamy,

Very often I have been facing this requirement. This becomes very tough to change the existing underlaying data model which is running for couple of months/years now. And this type of requirement is very common if you have noticed that. That is why, i am looking for a front end solution. May be somebody has explored and found a solution. I tried a logic using RowNo(Total) , but unfortunately rowno() does not work with FirstSortedValue(Please sombody prove me wrong).

i tried something like this:

FirstSortedValue(Sum(Sales), -Date, RowNo(TOTAL)+1)    // unfortunately rowno() here always returns 0

kalyandg
Partner - Creator III
Partner - Creator III

hi tresesco,

try this

rangesum(below(Total Sales, 0, rowno(Total)))

Thanks,

Kalyan

tresesco
MVP
MVP
Author

Hello Sundaram, thanks for your kind reply.

No, it does not work either. You can try with the attached qvw. I suspect the total keyword does not work as expected. Moreover, I would really appreciate if somebody can suggest a solution without using below() function and script work.

tresesco
MVP
MVP
Author

I would like to bring this thread on top for your attention. Please share your thoughts. Is it really not possible in the front end?

Thanks a lot..

tresesco
MVP
MVP
Author

Edit:

Gysbert_Wassenaar

Well, if you really want to do things the hard way... see attached example. Not recommended, but a nice exercise


talk is cheap, supply exceeds demand