Discussion Board for collaboration on QlikView Scripting.
I have a script like below
now the data is like this
Here I want to change the flag to 0 for souce C and id= T2, T3, T4 so on.
and rest of the entries should remain same.
You can use id conditions to quote it as
=If(Source='C',Flag=0) like this
If(src = 'C' And Match(id,'T2', 'T3', 'T4'), 0, flag) as flag
IF(Source = 'C' and (ID = 'T2' or ID = 'T3' or ID = 'T4'), 0, Flag) as Flag
Source, ID, Flag
A, T1, 1
B, T1, 1
C, T1, 1
C, T2, 1
if(match(Sourc,'C') and match(ID,'T2','T3','T4'),0, FLAG) as FLAG1
(html, codepage is 1252, embedded labels, table is @1);
=If(Source='C' and (ID=T2 or ID=T3 or ID =T4),Flag=0)
if(WildMatch(src,'C')=1 and WildMatch(id,'T1')=0, flag=0, flag) as flag
Actually the number of ids for which flag has to be overwritten is to be dynamic.
Have a variable tht is calculated and gives a value in the range of 2 or 3.
if variable = 3
then t4, t3, t2 flags are to be made 0.
If variable = 2
then t4, t3 flags are to be made 0. Please help
Use this variable.
if($(variable) = 3, match(Sourc,'C') and match(ID,'T2','T3','T4'),0,
if($(variable) = 2, match(Sourc,'C') and match(ID,'T3','T4'),0,Flag)) as New_Flag