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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Adding sum or avg in dummy field

Hello everyone,

I have a problem where i cannot find a way to add sum/avg in dummy value

Below is the table.

Qlik community 5.PNG

Notes: RANK  No 30 and Factory Average is the dummy value i've created in the load script.


Question:

Is it possible to assign the AVG(Total Uptime) for Rank 1, 2 and 3 IN Rank 30 Total Uptime??


Need your help everyone


Thank you for your time

&

Thank You in Advance!

1 Solution

Accepted Solutions
DavidŠtorek
Creator III
Creator III

Hi,

I did not noticed that you are using date. Only small change wil be needed

AvgTable:

Load

TotalUptime,

Date,

'Average' as Factory,

30 as Rank

;

Load

avg (TotalUptime) as TotalUptime,

Date

resident <your table>

where match(Rank,1,2,3)

Group by Date;

View solution in original post

4 Replies
DavidŠtorek
Creator III
Creator III

Hi,

What would solve your case is to create this dummy as separate table. Create table something like that

AvgTable:

Load

TotalUptime,

'Average' as Factory,

30 as Rank

;

Load

avg (TotalUptime) as TotalUptime

resident <your table>

where match(Rank,1,2,3);

Than if you use it in your table than it should look like your requirement.

Hope that hepls

Anonymous
Not applicable
Author

Dear Mr David,

Thank you for your time! I've tested the codes given and i found it very helpful

but maybe it will need one more filtering (Date)


Let me show you if we have data for two dates


Qlik community 6.PNG

The average include for both day. Means Total uptime for rank 1,2 and 3 for both date will be divided by 6.

I need to have average per day


Do you have any idea for this problem?


Thanks again!

DavidŠtorek
Creator III
Creator III

Hi,

I did not noticed that you are using date. Only small change wil be needed

AvgTable:

Load

TotalUptime,

Date,

'Average' as Factory,

30 as Rank

;

Load

avg (TotalUptime) as TotalUptime,

Date

resident <your table>

where match(Rank,1,2,3)

Group by Date;

Anonymous
Not applicable
Author

Thank You Mr David! It works!

download.jpeg

Thanks again!