Quantcast
Channel: SCN: Message List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 8968

Re: how to rank two columns using contains in Select statemen

$
0
0

Hi Fernando

 

Fernando Ros wrote:

- CONTAINS is only supported for Attribute View

 

That's not exactly true.

You can use CONTAINS also on Analytic Views but it's required to enable full text search on the attributes columns first.

AN_freestyle_search.png

 

A query like

 

SELECT

     "CATEGORY",

     sum("MARGIN") AS "MARGIN",

     sum("AMOUNT_SOLD") AS "AMOUNT_SOLD",

     sum("QUANTITY_SOLD") AS "QUANTITY_SOLD"

FROM "_SYS_BIC"."i028297.demo/AN_SALES"

where contains (category ,'*shirt*')

GROUP BY

     "CATEGORY"

 

will yield the expected result then (note how "shirt" appears in different forms) :

CATEGORY      MARGIN            AMOUNT_SOLD        QUANTITY_SOLD
2 Pocket shirts378.570,300000001441.072.995,7        5.442       
Shirts        24.047,5          68.354            352         
T-Shirts      5.120.879,29999997811.972.779,4000000866.657      

 

Nice, isn't it?

 

However, you are right in so far as you can only apply this settings to attributes that originate from attribute views. No key figures/measures or calculated columns are supported for this feature.

Nevertheless, a really nice thing to use in your OLAP queries, isn't it?

 

- Lars


Viewing all articles
Browse latest Browse all 8968

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>