Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Fix Value accorss Date

HI all,

I have a chart by Date. I want to calculate the avg Units and I want to show that as a straight line. Do not want to break by date.

For me it is coming as straight line, not avg.

Avg = sum(Unit)/count(day)

For my case count of days is not working in chart.

See the below chart it should show 35845.5 as 143382/4 .

I am attaching my sample App. Please check and help.

Thanks,

Sarif

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

i believe Your expression for SUM(Units) has a typo, it isn't restricting the data for the 4 days required,

it's missing the <=  in set analysis


check the attached app


Expression below

SUM({<DateHistory_Key = {">=$(=$(vMinDate))<=$(=$(vMaxDate))"}>}  AGGR( Sum(TOTAL {<DateHistory_Key = {">=$(=$(vMinDate))<=$(=$(vMaxDate))"}>} OrdersReceivedUnits)

/

count(DISTINCT TOTAL DateHistory_Key)

,CstDate))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

3 Replies
mhmmd_srf
Creator II
Creator II
Author

Attaching a small App.

vinieme12
Champion III
Champion III

i believe Your expression for SUM(Units) has a typo, it isn't restricting the data for the 4 days required,

it's missing the <=  in set analysis


check the attached app


Expression below

SUM({<DateHistory_Key = {">=$(=$(vMinDate))<=$(=$(vMaxDate))"}>}  AGGR( Sum(TOTAL {<DateHistory_Key = {">=$(=$(vMinDate))<=$(=$(vMaxDate))"}>} OrdersReceivedUnits)

/

count(DISTINCT TOTAL DateHistory_Key)

,CstDate))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
tresesco
MVP
MVP

This?

=Sum({<DateHistory_Key = {'>=$(=$(vMinDate)) <$(=$(vMaxDate))'}>} OrdersReceivedUnits)/ count(distinct DateHistory_Key)

If not, please explain your expected output.