Hi
Can you please provide your backend database & table structure?
What I think is you can apply logic on universe or IDT level by applying derived table.
You can create query like
select result2.city,
case when result2.ranking = 1 then ranking2.value end,
case when result2.ranking = 2 then ranking2.value end,
case when result2.ranking = 3 then ranking2.value end
from
(select Result1.city,
value
rank() over (order by value ) ranking from
(select distinct city,
value
from table
where date between @prompt('date1','D',,,,) and @prompt('date2','D',,,,)
group by city)Result1
)result2
This syntax will work for Oracle.
Thanks,
Swapnil