Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
rathnam_qv
Creator
Creator

Flags


Hi All

i have nearly 1300 Accounts ...

i want to create 1 flag for 21 Accounts...and another flag for remaining Accounts..

So, How to create That Flags...

Can any one help me

Thanks in Advance!!!

Smiley

8 Replies
rajeshvaswani77
Specialist III
Specialist III

Create a column using if condition, if the conditin is true you have one value( for 21 accounts) and in else you will have another value. Call this new column name as flag or any appropriate name.

thanks,

Rajesh Vaswani

rathnam_qv
Creator
Creator
Author

Hi,

can u please send me the script

MayilVahanan

Hi

try like this

If(Accounts <= 21, 1, 0) as Flag

or

If its not in order, then try with match() function , like

if(match(Account,1,2,34,5,67,889,45,46), 1, 0) as Flag

hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
rathnam_qv
Creator
Creator
Author

Hi,

i know the 21 account numbers...remaining i don't know...

then

kalyandg
Partner - Creator III
Partner - Creator III

hi rathnam,

for 21 accounts(which do u know)

try as the above reply by mayilvahanam

for the next 21,

try as

if(Accounts<>21, 1,0) as Flag2

kindly reply

Thanks,

Kalyan

jagan
Luminary Alumni
Luminary Alumni


Hi,

Try like this

LOAD

*,

if(match(Account,1,2,3, .....................your 21 account), 1, 0) as Flag,

if(not match(Account,1,2,3, .....................your 21 account), 1, 0) as RemainingAccountsFlag

FROM Datasource;

Regards,

Jagan.

Not applicable

try according to this condition

If(Accounts <= 21, 1) as Flag1

If(Accounts > 21, 0) as Flag2

***************************************

or add rowno() as key

then try

if(key<=21,1) as flag1,

if(key>21,0) as flag2

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

If(Match(Accountnumbers, 1,2,3,4,5....,21), 1, 0) AS Flag

Here Flag =1 has account numbers you know. Flag =0 has remaining account numbers