Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
I have below table and 3 fields .
I wann create Flag in Backend , For each ID , if For Price is" Yes" Atleast once (Greater or equal to 1) then Flag as 1 else 0
ID | Country | For Price | FLAG ( to be created in backend ) |
1 | AQ | Yes | 1 |
1 | AW | No | 1 |
1 | AE | No | 1 |
2 | AE | No | 0 |
2 | AQ | No | 0 |
3 | AW | Yes | 1 |
3 | AS | Yes | 1 |
4 | AE | No | 1 |
4 | AQ | Yes | 1 |
Advance Thanks
try below
Data:
LOAD ID,
Country,
[For Price]
FROM
[https://community.qlik.com/t5/Qlik-Sense-App-Development/If-condition-and-Flag-creation/td-p/1737817]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);
Left Join(Data)
LOAD ID,
Concat([For Price],',') as [All For Price]
Resident Data
Group by ID;
Final:
LOAD *,
if(Index([All For Price],'Yes'),1,0) as Flag
Resident Data;
DROP Table Data;
DROP Field [All For Price];
try below
Data:
LOAD ID,
Country,
[For Price]
FROM
[https://community.qlik.com/t5/Qlik-Sense-App-Development/If-condition-and-Flag-creation/td-p/1737817]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);
Left Join(Data)
LOAD ID,
Concat([For Price],',') as [All For Price]
Resident Data
Group by ID;
Final:
LOAD *,
if(Index([All For Price],'Yes'),1,0) as Flag
Resident Data;
DROP Table Data;
DROP Field [All For Price];
Thanks Kush
works Fine .
Just a small query .
can you suggest what approach can i take instead of left join cause when i ran it took 30 min for 14 million records