Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anyone know how to find value of field a when field b is equal to variable 1 and store that result as a variable?
Regards,
I assume there is an unambiguous value for a when b equals variable1, then you might try something like
=only({<b = {'$(variable1)'}>} a)
as variable definition in variable overview.
Hope this helps,
Stefan
Variable thats still giving me a null (My goal to fix):
=only({<[Time-Date] = {'$(vMinTime)'}>}[Adj. Close])
vMinTime (Variable 1):
=min([Time-Date])
Two things that come to my mind:
- ensure that the format of your variable matches the text format of your field, i.e. maybe you need to format the variable like
=timestamp(min([Time-Date]),'YYYY-MM-DD hh:mm:ss')
- Are there possibly multiple values of [Adj. Close] for the min [Time-Date]? If so, which value do you want to be returned?
The format automatically changes to numeric i think in these evaluations. I know that the vMinTime variable is numeric. I've also tried num([Time-Date]) = {'$(vMinTime)'} and [Time-Date] = {'$(vMinTime)'} with timestamp(min([Time-Date]),'YYYY-MM-DD') for my vMinTime variable. There are multiple [Adj. Close] for each vMinTime, one for each Ticker, but I make a selection of only one ticker value so should only be one possible value of Adj. Close)