Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
shwetagupta
Partner - Creator II
Partner - Creator II

GetField Selection in YTD

Hi All,

I have used get selection with if condition in my variable. Variables are giving desired vales when put individually (Without using = sign).

but while taking in range it fails.

Need Suggestion

vYearStart= If(GetfieldSelections(Month)<=1,(Yearstart(Max(Date),0,4)),

                           (IF(GetFieldSelections(Month)>1,(MakeDate(Year(Max(Date)),Month(Min(Date)),01)),(Yearstart(Max(Date),0,4)))))

vYearEnd= If(GetFieldSelections(Month)>0, Date(MonthEnd(Max(Date)),'DD/MM/YYYY'), Date((Max(Date)),'DD/MM/YYYY'))

Range : '>=vYearStart<=vYearEnd' : No Result on using Range.

YTD = Sum({<Date={'>=$(vYearStart)<=$(vYearEnd)'}>}Qty) : No Result.

Suggestions Please !!

7 Replies
vinieme12
Champion III
Champion III

what is your vYearStart incase user selects more than 1 month??

I would prefer using a master calendar for simpler calculations

Year = {'$(=Max(Year))'}

Month= {'<=$(vMonth)'}   where vMonth = your Month Selection!

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shwetagupta
Partner - Creator II
Partner - Creator II
Author

Hi Vineeth,

In case of more than one selection :

For Example I have Selected : May & June the my vYearStart is 01/05/2016.

Ques : Ideally If i ll select a month in YTD will it give me the result of that particular month or till that month ?

vinieme12
Champion III
Champion III

can you post sample app?

Check using one variable at a time

Sum({<Date={'$(vYearEnd)'}>}Qty) << does this evaluate?


Sum({<Date={'>=$(vYearStart)'}>}Qty) << does this evaluate?



Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shwetagupta
Partner - Creator II
Partner - Creator II
Author

Sry, Cant fetch the data out.  I ll try to create the sample !!

Meanwhile, can you tell me , is there any limitation of using if condition in the variable ?

vinieme12
Champion III
Champion III

Nope, no limits

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shwetagupta
Partner - Creator II
Partner - Creator II
Author

Single variable doesnot give any result over Sum.

vinieme12
Champion III
Champion III

Then the variables are the problem

try

Sum({<Date={'>=$(=vYearStart)<=$(=vYearEnd)'}>}Qty)


or

Sum({<Date={'>=$(=DATE($(vYearStart),'DD/MM/YYYY'))<=$(=DATE($(vYearEnd),'DD/MM/YYYY'))'}>}Qty)


or

Sum({<Date={">=$(=DATE($(vYearStart),'DD/MM/YYYY'))<=$(=DATE($(vYearEnd),'DD/MM/YYYY'))"}>}Qty)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.