How to create a variable in Bex Query Designer
Hi guys,
I am writing a query for a travel management report using the SAP Standard cube. I would like to restrict the query so it only shows me the last two months excluding the current month. I have checked BI content in RSA1, but I canu2019t find a relevant SAP standard variable that I can use.
Can anyone please tell me if I can create my own? And if so, how I can do this.
Many Thanks
Forhad.
Former Member replied
lets say u want to display following picture:
-
sept$-----august$
City
-chicago123$--
44$
so in Query designer go to Default values section.
Bring in Calendar month
right click calendar month
and hit Restrict
now select variable
use standard sap variable Current Month.
hit okey
now select Variable and hit Red button
Result u restricted current month.
in columns bring in keyfigure $
right click and hit edit
bring in time field calendar month
right click and hit restrict
bring in Current month
right click and select - SET OFFSET FOR VARIABLE
select -1
hit okey
repeat the above process
and this time select offset = -2
this way u restricted current month
but displayed last 2 months for keyfigure values.