Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SET ANALYSIS compare string dates

Table 1 has date field RES_DATE held as string eg '2012-09-23'. Table 2 has date field PERIOD_START held as string eg '2012-06-01'. How can I use set analysis to select RES_DATE >= PERIOD_START. Tried this count({$<PERIOD_START = {>=RES_DATE}>) but does not work / syntax wrong

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You may have another problem too. Set analysis creates a set per chart, not per row. So comparing fields on the same row in a chart in set analysis may not do what you expect. See this document: set_analysis_intra-record.qvw

You can use the date# function to create a numeric date from a string. That allows you to compare string dates by first turning them into numeric dates. It's best to use the date# function in the script to create the numeric dates there. This will add almost no overhead to the reload, but will make things very much easier (and better performing) in the UI.


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
lironbaram
Partner - Master III
Partner - Master III

hi assuming you want the RES_DATE to be later then the min value of the Period_START

you can use

count({<RES_DATE={">=$(=min(PERIOD_START))"}>} RES_DATE)

MayilVahanan

HI

Convert string field into date or num, then use like below

count({$<PERIOD_START = {"=PERIOD_START >=RES_DATE"}>ExpressionFieldName)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
CELAMBARASAN
Partner - Champion
Partner - Champion

You can convert it in to Date if you have an option.

Other wise try like below

Count({<UniqueField = {"=Date(Date#(PERIOD_START))>=Date(Date#(RES_DATE))"}>} FieldName)

Gysbert_Wassenaar

You may have another problem too. Set analysis creates a set per chart, not per row. So comparing fields on the same row in a chart in set analysis may not do what you expect. See this document: set_analysis_intra-record.qvw

You can use the date# function to create a numeric date from a string. That allows you to compare string dates by first turning them into numeric dates. It's best to use the date# function in the script to create the numeric dates there. This will add almost no overhead to the reload, but will make things very much easier (and better performing) in the UI.


talk is cheap, supply exceeds demand
Not applicable
Author

thankyou

Not applicable
Author

worked great thanks