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

Re: Variable to filter range

$
0
0

Hi Christoph,

 

 

Variable work only "outside" the view so it exist on where clause and so you can't achieve what you want passing only one information. What you can do is pass a range but in this case user that will calculate.

 

You can use input parameter which work "inside" the view and in this case you can do calculations and filter as earlier as possible producing the desired effect.

 

Example:

- define one input parameter P_YYYYMM NCHARVAR 6

- inside on your calculation you need put on expression a filter like

"YYYYMM" <= '$$P_YYYYMM$$' and

"YYYYMM_36" >=leftStr(replace(string(adddays(leftStr('$$P_YYYYMM$$',4) + '-' + rightStr('$$P_YYYYMM$$',2) + '-01',-1080)),'-',''),6)

 

where:

YYYYMM is the original column on format 201412

YYYYMM_36 is the calculated column you mentioned that alread exist

 

I didn't tested but it's a suggestion to you move forward. Check and adjust what is needed.

 

Regards, Fernando Da Rós


Viewing all articles
Browse latest Browse all 8968

Trending Articles



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