Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
afshan
Contributor
Contributor

variable input date range

i want to add date range {<Transaction_Date={">=$(VStartDate1)<=$(VEndDate1)"}>} with my dimension as sales

which i have calculated as follows

If(
GetFieldSelections([Select to See]) = 'AED',
Sum({$<TRANSACTION_DESC={'Sale / Distribution'},[Posted Date] = {">=$(vMTD_StartDate) <=$(vYTD_EndDate)"}, [Posted Year]=, [Posted Month]=>}(Lc_Amt * Rate)),
If(GetFieldSelections([Select to See]) = 'USD',
Sum({$<TRANSACTION_DESC={'Sale / Distribution'},[Posted Date] = {">=$(vMTD_StartDate) <=$(vYTD_EndDate)"}, [Posted Year]=, [Posted Month]=>}(Lc_Amt / Rate2)),
Sum({$<TRANSACTION_DESC={'Sale / Distribution'},[Posted Date] = {">=$(vMTD_StartDate) <=$(vYTD_EndDate)"}, [Posted Year]=, [Posted Month]=>}(Lc_Amt))
)
)

 

 

 

Labels (6)
1 Reply
rubenmarin

Hi, you can try switching posting by transacion data, depending of your model or selctions maybe you nee to keep other fields to ignore, or you can just keep only the transaction date.

Other fields like Lc_Amt, Rate... should have a relation or be in the same table as Transaction_Date

If(
GetFieldSelections([Select to See]) = 'AED',
Sum({$<TRANSACTION_DESC={'Sale / Distribution'},Transaction_Date={">=$(VStartDate1)<=$(VEndDate1)"}, [Posted Year]=, [Posted Month]=>}(Lc_Amt * Rate)),
If(GetFieldSelections([Select to See]) = 'USD',
Sum({$<TRANSACTION_DESC={'Sale / Distribution'},Transaction_Date={">=$(VStartDate1)<=$(VEndDate1)"}, [Posted Year]=, [Posted Month]=>}(Lc_Amt / Rate2)),
Sum({$<TRANSACTION_DESC={'Sale / Distribution'},Transaction_Date={">=$(VStartDate1)<=$(VEndDate1)"}, [Posted Year]=, [Posted Month]=>}(Lc_Amt))
)
)