Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
djbloiss
Contributor III
Contributor III

Find a specific Field Record combination in table

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. 

1 Solution

Accepted Solutions
sunny_talwar

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;

View solution in original post

15 Replies
YoussefBelloum
Champion
Champion

Hi,

can you add random data with an example ?

djbloiss
Contributor III
Contributor III
Author

Unique Value (not the key though)
Return Value
UV110
UV220
UV330
UV440
UV550
UV660
UV770
UV880

I have UV3 and I want to return 30.

sunny_talwar

May be this

Only({<[Unique Value] = {'UV3'}>} [Return Value])

YoussefBelloum
Champion
Champion

what do you want to do with this ?

show only one row with UV3 and 30 ?

filter the table from the script ?

djbloiss
Contributor III
Contributor III
Author

sunny but how will I tell it what table to pull that from?

djbloiss
Contributor III
Contributor III
Author

I need to use it in set analysis.

djbloiss
Contributor III
Contributor III
Author

btw when I say table I mean I need to pull it from a data table, not a straight table or pivot table.

sunny_talwar

Is this data in some field? I mean is UV3  a field value and is 30 a field value or an expression's output?

djbloiss
Contributor III
Contributor III
Author

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?