Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm trying to fetching previous date data in measure by using set expression . My date in number format .
Code :
sum( {$<NUM_DATE=${('v_pre_date')}>} KNIT_BACKLOG_OPENGT )
//Date in number format
//variable value = today(date(NUM_DATE)) - 1
But my code is not working . Please help me .
hi @Zarnabkhan ,
You can calculate the previous date using these ways
Sum({$<NUM_DATE={'$(Max(NUM_DATE)-1)'}>}KNIT_BACKLOG_OPENGT)
(or)
2.Use variable
a. Create variable : vPreviousDate = Max(NUM_DATE)-1
b. Use set analysis : =Sum({$<[NUM_DATE]= {"$(=vPreviousDate)"}>} KNIT_BACKLOG_OPENGT)
regards,
raji
Thanks Raji , i tried , but your solution is not working . With fix date working fine.
=sum( {$<[DATE.autoCalendar.Date]={"6/14/2020"}>} KNIT_BACKLOG_OPENGT )
above line with date format working fine but date in number format and using variable is not working .
=Sum({$<[NUMDATE]= {"$(=vPreviousDate)"}>} KNIT_BACKLOG_OPENGT)
above code compiles but gives logical error.
Please Help.
Regards:
Zarnab Khan
how did you define the variable? Try this way
=Sum({$<[NUMDATE]= {"=$(=vPreviousDate)"}>} KNIT_BACKLOG_OPENGT)
Your variable definition needs to be corrected I guess. Try like:
vPreviousDate = today() - 1
Thanks to all , your solutions compiles successfully but giving no results.
could you please check your field name?please share your set expression and variable value
Try to share your sample app. Also try like:
vPreviousDate = Date(today() - 1, 'M/D/YYYY')
=Sum({$<[NUMDATE]= {'$(=vPreviousDate)'}>} KNIT_BACKLOG_OPENGT)
Dear Tresesco thanks for your reply , but your expression giving error please check attached screen shorts .
Put '=' sign in variable definition and try.