Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a script like below
Load
src,
id,
flag
From a.qvd
now the data is like this
Sourc | ID | FLAG |
---|---|---|
A | T1 | 1 |
B | T1 | 1 |
C | T1 | 1 |
C | T2 | 1 |
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.
Please suggest
You can use id conditions to quote it as
=If(Source='C',Flag=0) like this
Hi
Load
src,
id,
If(src = 'C' And Match(id,'T2', 'T3', 'T4'), 0, flag) as flag
From a.qvd
HTH
Jonathan
Load
Source,
ID,
IF(Source = 'C' and (ID = 'T2' or ID = 'T3' or ID = 'T4'), 0, Flag) as Flag
Inline
[
Source, ID, Flag
A, T1, 1
B, T1, 1
C, T1, 1
C, T2, 1
];
Hi,
Try this,
LOAD Sourc,
ID,
FLAG,
if(match(Sourc,'C') and match(ID,'T2','T3','T4'),0, FLAG) as FLAG1
FROM
[http://community.qlik.com/thread/128622]
(html, codepage is 1252, embedded labels, table is @1);
-- Regards,
Vishal Waghole
Try below
=If(Source='C' and (ID=T2 or ID=T3 or ID =T4),Flag=0)
Regards
ASHFAQ
Hi,
Load
src,
id,
if(WildMatch(src,'C')=1 and WildMatch(id,'T1')=0, flag=0, flag) as flag
From a.qvd
HTH
Andrei
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
HI,
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
Regards,
Kaushik Solanki