Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Suggest

After I did some kind of transfarmations using left join and creating flags my table is look like this.

Now am trying to create another flag based on the F1.

Load only first value based on the empno where F1=1

12 Replies
tamilarasu
Champion
Champion

Hi Babi,

I am not sure if i understood you correctly but you can try

Load *

From Table

Where F1= '1';

neha_shirsath
Specialist
Specialist

Hi Babi,

Can you share some sample data or please explain in detail.

Thanks & Regards,

Neha S.

Not applicable
Author

It doesn't work nagaraj that's not my requirement.

My requirement is to create flag for only first value where F1=1

Based on the empno.

Pls suggest

PrashantSangle

Hi,

F1 is column name from your table

If yes then in script try like

if(F1=1,'true','False') as flag

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
neha_shirsath
Specialist
Specialist

Hi Babi,

You can try like-

If(F1='1', EmpNo) as Flag.

And suppress null values in your table/chart.

Thanks & Regards,

Neha S.

tamilarasu
Champion
Champion

Hello Babi,

Could you post sample input and expected output?

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

Like this??

Data:

LOAD * INLINE [

    Customer, Typology, PartNumber, TotalAmount

    customer1, typology1, 1, "316,032"

    customer1, typology1, 4, "231,694"

    customer1, typology1, 7, "202,305"

    customer1, typology1, 1, "197,223"

    customer1, typology2, 4, "163,248"

    customer1, typology2, 7, "125,838"

    customer1, typology2, 1, "113,576"

    customer1, typology2, 4, "103,068"

    customer1, typology2, 7, "90,984"

    customer1, typology2, 1, "49,840"

    customer2, typology1, 4, "65,039"

    customer2, typology1, 7, "63,584"

    customer2, typology1, 1, "22,121"

    customer2, typology1, 4, "8,870"

    customer2, typology1, 7, "6,944"

    customer2, typology1, 1, "5,321"

    customer2, typology2, 4, "5,204"

    customer2, typology2, 7, "5,116"

    customer2, typology2, 7, "4,211"

    customer2, typology2, 1, "2,911"

    customer2, typology2, 4, "2,881"

    customer2, typology2, 7, 470

];

Final:

LOAD *,

'Level 1' as Flag

Resident Data Where PartNumber=1 ;

Concatenate

LOAD *,

'Level 2' as Flag

Resident Data Where PartNumber=4 ;

Concatenate

LOAD *,

'Level 3' as Flag

Resident Data Where PartNumber=7 ;

DROP Table Data ;

-Nagarjun

PrashantSangle

Hi,

why are loading same table multiple times??
Instead of that, 1 if - else statement work

Load *,if(PartNumber=1,'Level 1',if(PartNumber=4,'Level 2','Level 3')) as flag from table;

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Can we do dynamically ???