Jump to content

Month duration input value in spotfire


Naveen Tibco

Recommended Posts

Hello Friends,

i have year,Month dropdown property and monthduration(input filed) property in text area.

can any one suggest me limit data or custom expression in table.

Year Month duration

2016 Apr 9

may

jun

jul

Aug

sep

Oct

nov

Dec

Jan 2017

above sample if user select year 2016 and month "Apr" and dropdown property and duration "9" (input filed ) means Apr + 9 months that would be jan 2017 values has to be displayed in Table.

can any one help me any limit data expression or custom expression.

Thanks

Naveen

Link to comment
Share on other sites

It strongly depends on how you format your months, but essentially:

(1) ParseDate(Concatenate("1-",[mymonth],"-",[myyear]),"d-MMM-yyyy)

Will create a date from the first day of your month column ([mymonth]) and your year column ([myyear]).

Then you need to create a cutoff date using your drop-down properties.

Here if the value of your month drop-down was mapped to an integer value, it would be easiest and your cutoff date is

(2) DateAdd('month',${selduration},Date(${selyear},${selmonth},1))

Where ${selduration} is the selected duration (e.g. 9), ${selyear} is the selected year and ${selmonth} is the selected month (an integer 1 to 12)

If instead you assign your drop-down ${selmonth} to a string you need to re-create the date using ParseDate:

(3) DateAdd('month',${selduration}, ParseDate(Concatenate("1-",'${selmonth}',"-",${selyear}),"d-MMM-yyyy") )

Note also the format: MMM is for an abbreviated month string (e.g. Jan) whereas for a full month string (e.g. January) you need to use MMMM.

Then you use Limit data using expression in your table properties (Data tab) to impose that your date (1) must be equal, less, or whatever, to your cutoff date (2 or 3).

See this link for format details:

https://docs.tibco.com/pub/spotfire/6.5.0/doc/html/ncfe/ncfe_format_stri...

Gaia

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...