Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
oseimuduame
Creator II
Creator II

Average Sales by Days

Good Morning Guys,

I am having issue with a report on Qlikview, i want to be able to run an average sales report by day. This means that if i made a sales of 100000 in a month that the invoice days is 28, i want to be able to get the average sales.

Avg = Total Sales / No of Invoice Days

Note: i am suppose to use Avg = Total Sales / No of Days but there are days when no sales was made.


I used AVG(INVC_PRICE) but not getting the correct result.


Any help please

18 Replies
YoussefBelloum
Champion
Champion

Hi,

would you be able to share sample app or sample data ?

sunny_talwar

May be this

Sum(Sales)/Count({<Date = {"=Sum(Sales) > 0"}>}Date)

oseimuduame
Creator II
Creator II
Author

Hi Sunny,

I used the above script and i still not get the right answer.

For Example i run a report for a store that sold 590150 and the total number of days invoice was raised for the store is 15, i am suppose to have 590150/15 but instead my result was 23606.

Any idea please ?

oseimuduame
Creator II
Creator II
Author

For Example i run a report for a store that sold 590150 and the total number of days invoice was raised for the store is 15, i am suppose to have 590150/15 but instead my result was 23606.

sunny_talwar

Can you check the values for each part of the expression

1) Sum(Sales)

2) Count({<Date = {"=Sum(Sales) > 0"}>}Date)

See which of the two are not giving the right values.... and then we can check what we can do next... Also, an image might help see the issue better

oseimuduame
Creator II
Creator II
Author

Hi Sunny,

i think the second script has the issue in the sense that it is not giving the correct figure.

the script is to count the number of days invoice was raised  but currently it is not

sunny_talwar

What is the number it is giving and what do you expect to see?

oseimuduame
Creator II
Creator II
Author

avg.PNG

From the above Screenshot;

1) Sum(Sales) = Total Sales

2) Count({<Date = {"=Sum(Sales) > 0"}>}Date) = Count


This is a filter for a Store and the Day sales was made is the white areas under DAY.


Day = 15 but the Formula is giving me 25

bbmmouha
Creator
Creator

Avg( Aggr( Sum(sales), Day ) )