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

Set Analysis

Hello, good if someone can help me please, I would appreciate it very much.

I need that the day, month, year, date not only correspond to that variable, but to another that is called vMaxDay.

Current code:

sum ({<day, month, year, Date = {"$ (vLastDay)"}, FLAG_TITLE = {'S'}, CATEGORY = {'Available for Sale'}>} PRICE_MERCED)

4 Replies
Digvijay_Singh

Do you mean Date needs to be compared with vLastDay AND vMaxDay? Are these variables assigned Date value in date format?

sum ({<day, month, year, Date = {$(vLastDay)>*<day, month, year, Date = {$(vMaxDay)>+< FLAG_TITLE = {'S'}, CATEGORY = {'Available for Sale'}>} PRICE_MERCED)

jwjackso
Specialist III
Specialist III

If Date is your transaction date and the variable vLastDay and vMaxDay are in the same format, you could try the following if you are trying to get data between the 2 dates:

sum({<Date={">=$(vLastDay),<=$(vMaxDay)}, FLAG_TITLE = {'S'}, CATEGORY = {'Available for Sale'}>} PRICE_MERCED)


Also check out creating a calendar table, How to create a Calendar

Once you have a calendar table you can build variable for different time periods, like a prior MTD and just drop the variable into the set analysis.

LET vPriorMTD = Replace('MonthID = {"@(=Max(MonthID) - 1)"}, Date =  {"<=@(=AddMonths(Max(Date), -1))"}','@','$');

Anonymous
Not applicable
Author

Thanks Digvijay, Let me check the code.

Anonymous
Not applicable
Author

Thanks Jerry for your valuable contribution. I will keep in mind to create a Calendar.