Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In an expression I have a unique value and I need to pull a specific field value from a table. How can I do this? I tried looking at the peek function (I know peek can only be used in the script) and at the previous function but I cannot figure it out? If I cannot do it in an expression I am willing to do it in a script and save it in a variable.
This is one way to do it in the script
Table:
LOAD DateKey,
[Transaction Date],
[Week Count]
FROM
[..\..\Downloads\SampleData (1).xlsx]
(ooxml, embedded labels, table is MultiCalendar);
Temp:
LOAD [Week Count]
Resident Table
Where [Transaction Date] = Today();
LET vCurrWeekCount = Peek('Week Count');
DROP Table Temp;
Hi,
can you add random data with an example ?
Unique Value (not the key though) | Return Value |
---|---|
UV1 | 10 |
UV2 | 20 |
UV3 | 30 |
UV4 | 40 |
UV5 | 50 |
UV6 | 60 |
UV7 | 70 |
UV8 | 80 |
I have UV3 and I want to return 30.
May be this
Only({<[Unique Value] = {'UV3'}>} [Return Value])
what do you want to do with this ?
show only one row with UV3 and 30 ?
filter the table from the script ?
sunny but how will I tell it what table to pull that from?
I need to use it in set analysis.
btw when I say table I mean I need to pull it from a data table, not a straight table or pivot table.
Is this data in some field? I mean is UV3 a field value and is 30 a field value or an expression's output?
What I am specifically doing is trying to use Today's date to find a specific week_count in my CalendarTable and then use that in set analysis to filter results.
Remember I am new and I am trying to think of solutions. so I have been searching and using a lookup value in my script to set a variable seems like it might work. Do you think that would be a good solution?