Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
tresB
Champion III
Champion III

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.

Labels (1)
10 Replies
MayilVahanan
MVP
MVP

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.
tresB
Champion III
Champion III
Author

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

MayilVahanan
MVP
MVP

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.
tresB
Champion III
Champion III
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

tresB
Champion III
Champion III
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.

tresB
Champion III
Champion III
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..

tresB
Champion III
Champion III
Author

Edit:

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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