Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have a problem where i cannot find a way to add sum/avg in dummy value
Below is the table.
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!
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;
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 ![]()
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
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!
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;
Thank You Mr David! It works!

Thanks again!