Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mohdhaniff
Creator
Creator

Create variable from data fields

Hi,

Please help me how to create variables from existing data in QlikView. I wish to have a list of value for 'ReportMth' = Rep.

DATA:

NoConcatenate

LOAD Distinct * Inline [

Rep

01/04/2017

02/06/2017

];

let ReportMth = FieldValue(Rep,DATA);

1 Solution

Accepted Solutions
Anil_Babu_Samineni

May be this

LET a = FieldValue('Rep',1); // I've added single colon. Check in Ctrl + Alt + V environment

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

6 Replies
Anil_Babu_Samineni

Which value you want to set as variable. May be this?

LET ReportMth = FieldValue(Rep,1); //This will return firstvalue from Rep field

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
mohdhaniff
Creator
Creator
Author

Hi Anil,

I am getting blank result...

Anil_Babu_Samineni

May be this

LET a = FieldValue('Rep',1); // I've added single colon. Check in Ctrl + Alt + V environment

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
mohdhaniff
Creator
Creator
Author

Thanks Anil. Its work as my wish.

As additional, can you recommend me how to get all value in Rep listed into ReportMth

Anil_Babu_Samineni

May be this?

DATA:

NoConcatenate

LOAD Distinct * Inline [

Rep

01/04/2017

02/06/2017

];

//Script

LET noRows = NoOfRows('DATA')-1;

FOR i=0 to $(noRows)

LET vVar=FieldValue('Rep',$(i));

LOAD *, '$(vVar)' as ReportMth

Resident DATA;

Next i;

Or Simple do this

DATA:

NoConcatenate

LOAD Distinct Rep, Rep as ReportMth Inline [

Rep

01/04/2017

02/06/2017

];

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
mohdhaniff
Creator
Creator
Author

Thanks Anil..