Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am having a little issue
I have a variable that allows the user to input a date (vTodate).
I then have variable (test) that converts the input to a number =Num(Date(vToDate,'M/D/YYYY'))
In my load script, I am doing Num(Date(TransactionDate,'M/D/YYYY')) as TransDateNum
I created 1 more variable (Include) =if(TransDateNum < $(test) ,'L','G')
The value is never L
Thanks for your assistance.
You can try without creating test variable..
try
=if(TransDateNum < '$(vTodate)', 'L','G') as YourFieldName
have you tried
'$(test)'
Yes, no change
I was able to get the variable to change values, but only when selecting a transaction date. I don't want to have to do this if possible.
Is there something peculiar about your process that you're not telling us? It seems to work for me, at least at a preliminary level.
LET vToDate = Today()
;
LET vToDateNum = Num(Date(vToDate,'M/D/YYYY'))
;
TRACE 'vToDateNum' & $(vToDateNum)
;
DATA:
LOAD *,If(TransactionDate2 < $(vToDateNum) ,'L','G') AS 'TestValue'
;
LOAD Num(Date(TransactionDate,'M/D/YYYY')) AS 'TransactionDate2'
;
LOAD * Inline
[
'TransactionDate'
'3/11/2018'
'3/12/2018'
'3/14/2018'
'3/16/2018'
'3/19/2018'
'3/30/2018'
]
;
LET vNumberOfRows = NoOfRows('DATA')
;
TRACE $(vNumberOfRows)
;
EXIT Script
;
You can try without creating test variable..
try
=if(TransDateNum < '$(vTodate)', 'L','G') as YourFieldName
Try using floor() instead of num(); not sure if the Date formatting actually strips the time value (if there is one).
I am assuming that you have all three items in a table with your data to see it's never 'L' when it should be.
Justin
The variable on in the application and not the load script. I am using a variable extension to capture the user input and store it in a variable. I then want to use that variable and compare it against a object in the table and store the result as a variable.
Odd this is the logic works fine as a master measure.
That worked!
thanks