Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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. 

15 Replies
sunny_talwar

Would you be able to share few rows or data or an image of how your data looks like?

djbloiss
Contributor III
Contributor III
Author

Sunny,

I tried this and while it is not crashing there is no variable being created.

let vCurrWeekCount = Lookup('Week_Count', 'Transaction Date', Date(Now()), 'MultiCalendar');

the syntax looks correct and those are the correct field names and table name.

sunny_talwar

I won't know until I play around with it... would you be able to share a sample?

djbloiss
Contributor III
Contributor III
Author

use the multicalender tab

djbloiss
Contributor III
Contributor III
Author

sorry forgot to add the file

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;