Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Can we place in a variable with the field of distinct values in edit script load ?
Ex: Consider the in my table having FieldA and having values in it are 5
FieldA
1
1
2
3
4
Now i needs to have my variable vVar1 = 1,2,3,4
Thanks in advance.
Try this
set vVar='Fieldname';
Concat($(vVar),',')
Hi Sivaraj, thanks for your response. But concat function will not work in edit script.
Below scritp what i'm trying in my original project
If(vStep = 0) then
//Initial Load
Tab1:
LOAD CaptureDateTime
FROM
[..\QVD\4Weeks\EAT_20121029.qvd]
(qvd);
Let vVar = CaptureDateTiem;
ELSE
//Incremental Load
Tab1:
LOAD CaptureDateTime
FROM
[..\QVD\4Weeks\EAT_20121029.qvd]
(qvd) Where not Exists($(vVar));
ENDIF
I hope you might got what i'm looking for ?
Thanks in advance.
Concat works in script,am little confused with your script logic
Sorry,Yes Concat function is working in Edit Script.
I tried below script but not holding any values in vVar variable, just displays empty in vVar.
Tab1:
LOAD * Inline
[CaptureDateTime
1
1
2
3];
let noRows = NoOfRows('Tab1')-1;
for i=0 to $(noRows)
let vVar =Concat(peek('CaptureDateTime',$(i),'Tab1'),',');
next
Please let me know what is the wrong in this.
Thanks in advance
Use this
Tab1:
LOAD * Inline [
CaptureDateTime
1
1
2
3
5];
let noRows = NoOfRows('Tab1')-1;
for i=0 to $(noRows)
let vVar=FieldValue('CaptureDateTime',$(i));
LOAD * ,'$(vVar)' as Field1
Resident Tab1;
next i
In where clause use Field1 instead of variable
This might help for you
Hi,
Please have a look at the Qlikview Components:
http://code.google.com/p/qlikview-components/
Especially Qvc.PopulateVariables
That will do all of the above, but then a lot cleaner.
Kind Regards,
Dion
Hi venkatveer,
you can solve this using the concat function with a temporary table and then the peek function to assign the field value to the vVar1 variable.
See the attached file.
Regards
Jefferson Martins correctly answered your question.
Adding:
In the stretch :let vVar1 = peek ( ' FIELDA ', 0 , ' tmp ');
..if the name FIELDA field is with space, [ Field A] inform without symbols [ ] , example :
let vVar1 = peek ( 'Field A', 0 , ' tmp ');