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: 
Not applicable

Sales Improvement % by date

Dear Community,

I would like to write an expression to get % improvement in Sales by date comparison, but my expression seems like not working.

sum({$<Day = {$(=Only(Day))}>}Sales)-sum({$<Day = {$(=Only(Day)-1)}>}Sales)

Anyone could help?

I have attached the qvw file, table in excel sheet is the table that is needed to show on dashboard.

Thanks,

Chanel

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi Chanel,

PFA file for solution.

Regards,

Jagan.

View solution in original post

5 Replies
eduardo_sommer
Partner - Specialist
Partner - Specialist

Hi,

I saw in your data that you don't have consecutive days and day and day-1 compares consecutive days. If day is 8/12/2014, day -1 is 8/11/2014. Your dates are 1 week apart from each other.

Eduardo

jagan
Luminary Alumni
Luminary Alumni

Hi Chanel,

PFA file for solution.

Regards,

Jagan.

Not applicable
Author

Thanks Jagan! I have tried it out and is working perfectly.

=RangeSum(sum(Sales), -Before(Sum(Sales))) / Alt(Before(Sum(Sales), 1))

This is first time to use rangesum, before and Alt functions, do you mind to briefly explain on this?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find the explanation below

Rangesum(n1, n2, ....nm) - Will give you sum of n1 + n2 + ......+ nm (Even if one of the value is null you will get the sum for remaining values)

Before() - Will give you preceding column value of the same row

Alt() - will give the default value if expression value is null Ex: Alt(Expression, 'N/A') gives you 'N/A' if Expression returns null.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Lovely! Appreciate for your help!