Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
AtiT
Valued Contributor

No chart columns available for ranked dataset

Hi, I have a dataset that has ranked output with RANK() function used. The dataset is working but in the chart I cannot see the columns - no columns available. Has anybody tried something like this? Should I do something into the dataset or this type is not supported? The dataset: DROP TABLE IF EXISTS web1_tbl; DROP TABLE IF EXISTS web2_tbl; CREATE TEMPORARY TABLE web1_tbl AS SELECT * FROM ( SELECT COALESCE(NULLIFNA(`user`), `srcip`) AS user_src, SUM(COALESCE(`sentbyte`, 0)+COALESCE(`rcvdbyte`, 0)) AS bandwidth FROM $log WHERE $filter AND `status` IN (' accept' ,' close' ) AND `utmaction`=' passthrough' GROUP BY user_src HAVING SUM(COALESCE(`sentbyte`, 0)+COALESCE(`rcvdbyte`, 0))>0 ORDER BY bandwidth DESC LIMIT 3 ) t; CREATE TEMPORARY TABLE web2_tbl AS SELECT * FROM( SELECT TO_TIMESTAMP(`itime`)::timestamp AS time, TO_CHAR((`duration` || ' second' )::interval, ' HH24:MI:SS' ) AS dur, COALESCE(NULLIFNA(`user`), `srcip`) AS user_src, COALESCE(NULLIFNA(ROOT_DOMAIN(`hostname`)),' Unknown Website' )||' (' ||`dstip`||' )' AS website, COALESCE(NULLIFNA(`catdesc`),' Unknown Category' ) AS web_cat, SUM(COALESCE(`sentbyte`, 0)+COALESCE(`rcvdbyte`, 0)) AS bandwidth FROM $log WHERE $filter AND `status` IN (' accept' ,' close' ) AND `utmaction`=' passthrough' GROUP BY time, dur, user_src, srcip, website, web_cat HAVING SUM(COALESCE(`sentbyte`, 0)+COALESCE(`rcvdbyte`, 0))>0 ORDER BY bandwidth DESC ) t; SELECT * FROM ( SELECT web2_tbl.time, web2_tbl.dur, web2_tbl.user_src, web2_tbl.website, web2_tbl.web_cat, web2_tbl.bandwidth, RANK() OVER (PARTITION BY web2_tbl.user_src ORDER BY web2_tbl.bandwidth DESC) RANK FROM web2_tbl INNER JOIN web1_tbl ON web2_tbl.user_src=web1_tbl.user_src ) RANKED WHERE RANK<=10 ORDER BY user_src ASC, bandwidth DESC

AtiT

AtiT
2 REPLIES 2
mnantel_FTNT
Staff
Staff

This way over my head SQL-wise, so I can hardly answer your question. Let me make an inquiry and see if that should be supported. I suspect you are correct that it is not.

-- Mathieu Nantel Systems Engineer / Conseiller Technique - Fortinet Montreal, QC

mnantel_FTNT
Staff
Staff

AtiT, might be obvious, but at first glance the reason the chart library only displays one column (" *" ) is because thats all you have in your trailing select. Any way you can select columns instead of * ??

-- Mathieu Nantel Systems Engineer / Conseiller Technique - Fortinet Montreal, QC

Labels
Top Kudoed Authors