Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have a line graph with dates. I just want to display on my line chart the average value of the day, instead of the sum. This should happen very simply, however, there is no switch in the chart settings for the displayed results.
How can I implement this?
I tried the following, but nothing changes, it's still the sum:
avg(aggr( (sum(payments) / count(distinct user_id)) , signup_time))
Average per what? Since you use "Count(distinct user_id)", I guess the answer is "Average per User". Then you should use
Sum(payments) / Count(distinct user_id)
Hello! I need an average for the day. So I want to get a line graph in which I will see the cost dynamics of my measure by days (and I don't want it to be summed by the number of users, I just need an average value by 1 unit)
I use Sum(payments) / Count(distinct user_id)
but the linear chart shows me the sum of the values obtained by this measure for the day, and I want to get only one value.
You need to show what you mean. The expression calculates the average payments per user.
If "Sum(payments)" results in the same number as "Sum(payments) / Count(distinct user_id)", then you only have one user per dimensional value (signup_time). Perhaps you should use something else as dimension? E.g. Date.
I use the date as a measurement and my measure as a measure. But it gives me the sum on the line graph. For example, if the measure = 100 and there were 10 registrations for 1.01.22, the chart will show me 1000 for 1.01.22, but I want to see 100 there.
I need the dynamics of the cost by day for 1 unit, I don't want to see the sum there
dimension = day(signup_time)
so I need the average for the day, but when using aggr+ avg it still gives me the sum
the formula I gave in the example is greatly simplified, the main question is: HOW to make the chart show the average by 1 unit, and not the sum of the measure values for that day
Do you have more than one month of data? If so, you shouldn't use Day() as dimension. For example, Day()=1 will show all data for the first of the month, but it will be for ALL months - Jan, Feb, Mar, etc.
Unfortunately, even if I create a completely new application and upload there only one month and only one measurement with a date, qlik sense still shows only the sum of measure values in the line chart, it cannot show me just the average value...
I can assure you that the Qlik engine calculates the average if you have used Sum() / Count(). But since you don't get the numbers you expect, something else must be wrong.
I would start debugging by looking at a small dataset - just a few days - and use a bar chart or a table with
... just to better understand what happens.