I am looking for a resource that will serve as a foundation to understanding variables in Qlikview, when to use them, when to use Set vs Let, and how to use in formulas. I have found the below, but I was wondering if there is a better resource.
In my own script I am trying to create a variable that will store certain states that if shipped from a certain DC, would be classified as "over fence" shipments
My attempts that are failing:
Set vDC1OverFenceState= 'CA;OR;WA;ID;NV;AZ;AK;HI;UT;MT;WY;CO;NM;TX';
Set vDC2OverFenceState= 'ND;SD;NE;KS;OK;MN;IA;MO;AR;LA;WI;IL;KY;TN;MS;MI;IN;AL;OH;ME;NH;VT;MA;RI;CT;NY;PA;NJ;DL;WV;VA;FL;GA;SC;NC;MD;PR;VI';
IF(WH='DC1' and [SHIP TO STATE]= $(vDC1OverFenceState),1,0) as N7OverFence,
IF(WH='DC2' and [SHIP TO STATE]= $(vDC2OverFenceState),1,0) as L7OverFence,
I am thinking I need to use peek somehow, but something is missing in my logic. Any assistance appreciated.
If anyone is interested, here is how I got it to work. Thanks again for the excellent links.
SET vDC1OverFenceState= 'CA','OR','WA','ID','NV','AZ','AK','HI','UT','MT','WY','CO','NM','TX';
SET vDC2OverFenceState= 'ND','SD','NE','KS','OK','MN','IA','MO','AR','LA','WI','IL','KY','TN','MS','MI','IN','AL','OH','ME','NH','VT','MA','RI','CT','NY','PA','NJ','DL','WV','VA','FL','GA','SC','NC','MD','PR','VI';
IF(WH='DC1' and Match([SHIP TO STATE],$(vDC1OverFenceState)),1,0) as N7OverFence,
IF(WH='DC2' and Match([SHIP TO STATE],$(vDC2OverFenceState)),1,0) as L7OverFence,