Forum Discussion

Brighton10's avatar
Brighton10
Helper II
3 years ago

multiple queries for same table

Hi everyone

 

I have a table named table1. I have 3 report pages querying the same table but with different queries for example

page1 relies on:

select firstname, lastname, salary

from table1

where departmentName = 'IT'

page 2 relies on:

with maxSalary as(

select max(salary) over(partition by departmentName order by salary) maxSal

from table1)

select * from maxSalary where salary = maxSal

page 3 relies:

select count(userId), departmentName

from table1

group by departmentName

 

N.B These queries are just for demo purposes and can be complex that you cannot combine them in one query.

 

Is there a way to read from the same table without having to write 3 separate queries as the table will be loaded 3 times when refreshing which might not be favourable for perfomance? Will the concept of shared datasets work here? Thanks for your help in advance.

1 Reply