cancel
Showing results for 
Search instead for 
Did you mean: 

I'm trying to restrict date with number of days by selecting radio button selection ?

Former Member
0 Kudos

Using : DS 1.6 SP00 , BO 4.1 SP08

Scenario: I need to develop an application displaying Complaints data (pending, completed and total records) with time line inputs.

Radio button should consists of 30 days, 60 days, 90 days and 180 days.

If user select 30 days it should fetch last 30 days records and display the application.

I tried in design studio

var today = APPLICATION.getInfo().dateNowInternalFormat;

var last15 = Today-15; / APPLICATION.getInfo().dateNowInternalFormat -15;

I have seen so many function in design studio not working. Now I'm trying to get dates from back end so, that I can filter here, But suppose I'm getting Last 15 days, 30 days, 60 days from back end. Now which function should I be able to use.

SETFILTER format is not working: DS_1.setFilter("DATEDIMENSION",{"low":DATEOBJECT,"high":TODAY()});

MustafaBensan
Active Contributor
0 Kudos

Hi Ravi,

The syntax used for a range in setFilter() will depend on the data source. What are you using, BW, HANA or a Universe?

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

Thanks for the response.

I'm using BW as datasource. Please suggest me two resolutions.

One is on design studio end , how I can achieve dates and filter them on data sources.

Second one, I told Back end team (ABAP team) to provide 3 fields , last 30 days, 60 days and 90 days. they will provide me date objects as Last 30 = Today - 30 days, and same follows for rest of the objects.

Suggest me set filter syntax for above restrictions.

regards,

Ravi Bodala

TammyPowlas
Active Contributor
0 Kudos

Ravi - you are also on SP00 of 1.6, and that could be why so many functions are not working. Please consider updating to the latest SP for 1.6

Former Member
0 Kudos

Thanks Tammy Powals,

Suggest me some functions that suitable with syntax for my requirement.

Regards,

Ravi Bodala

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Ravi,

You may wish to consider using the SDK Community Simple Date Object Component. Also, if you can clarify how the "date objects" will be represented in your BEx Query (as dimensions(characteristics) or measures (key figures)), we can try to provide further guidance.

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

I'm trying continuously on this scenario.

Initially BEx Query has date dimension : Posting date, I used to give date field selection on click button I gave filter (DS_1.setFilter("DATEDIMENSION",{"low":DATEFIELD_1.getDate(),"high":DATEFIELD_2.getDate()});)

Now client requested change , he want radio button with last 30 days, 60 days and 90 days.

I tried formulas but not found any suitable one.

Currently BI team gave me Query as per my request but those dates are showing in key figures as shown.

How should i Initialize these date key figures to date object and restrict.

If possible give solution for both possibilities

with regards,

Ravi Bodala.

MustafaBensan
Active Contributor
0 Kudos

Hi Ravi,

Defining key figures as dates will not allow you to filter. There are two approaches you can take as follows:

1) Front-end

Design Studio 1.6 does not provide any script functions for date calculations. This is why I suggested that you try the SDK Community Simple Date Object Component to calculate the date ranges to apply in setFilter().

2) Back-end

You can use BEx Customer Exit variables as described in the post How to use Customer Exit Variables in BW Reports: Part 2. Here, you would need to create an optional manual input Text Variable to enter a code representing the time buckets, e.g. A = Last 30 days, B = Last 60 days, C = Last 90 days. This Text Variable would then serve as input to a Customer Exit Variable on characteristic Posting Date, to restrict the date range based on the time bucket selection. The Radio Button values would represent the time bucket codes (A,B,C). The selected code would then be passed to the BEx Query Text Variable using the dataSource.setVariableValueExt() script call.

Regards,

Mustafa.

Answers (0)