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: 
deepakqlikview_123
Specialist
Specialist

Flag

Hello Experts,

Can you pleas tell me ,

how the flag works in below expression

 

Flag&'-'&'FAB'&'-'&( if(((hour(MANUFACTURING_DATE)&':'&minute(MANUFACTURING_DATE)&':'&second(MANUFACTURING_DATE))>='07:00:00') and ((hour(MANUFACTURING_DATE)&':'&minute(MANUFACTURING_DATE)&':'&second(MANUFACTURING_DATE))<= '15:30:59'),1,
if(((hour(MANUFACTURING_DATE)&':'&minute(MANUFACTURING_DATE)&':'&second(MANUFACTURING_DATE))>='15:31:00') and ((hour(MANUFACTURING_DATE)&':'&minute(MANUFACTURING_DATE)&':'&second(MANUFACTURING_DATE))<= '23:59:59'),2,
if(((hour(MANUFACTURING_DATE)&':'&minute(MANUFACTURING_DATE)&':'&second(MANUFACTURING_DATE))>='00:00:01') and ((hour(MANUFACTURING_DATE)&':'&minute(MANUFACTURING_DATE)&':'&second(MANUFACTURING_DATE))<= '06:59:59'),3
)
)))
as FabKey,

thanks,

Deepak

5 Replies
its_anandrjs

This flag is working like

1.You have already a Flag field

2. then in that field you concate 'FAB' letter

3. after that you check MANUFACTURING_DATE for Hour Minute and Second combination like

if MANUFACTURING_DATE lies between >='07:00:00' and <= '15:30:59' then say 1 and

if MANUFACTURING_DATE lies between >='15:31:00' and <= '23:59:59' then 2 and

if MANUFACTURING_DATE lies between >='00:00:01' and <= '06:59:59' then 3

then your key like Flag-FAB-1 or Flag-FAB-2 or Flag-FAB-3

Hope this helps

Thanks & Regards

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

you can rewrite this:

Flag & '-' & 'FAB' & '-' &

(

  if(Time(MANUFACTURING_DATE, 'hh:mm') <= '06:59'), 3

  if(Time(MANUFACTURING_DATE, 'hh:mm') <= '15:30'), 1,

  2

)

))) as FabKey,

Which should make it a little clearer.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
deepakqlikview_123
Specialist
Specialist
Author

Why we can use flag,can you please tell me some benefits of using flag in script

its_anandrjs

1.If we want to get any filter for the application for selection

2.If we want to remove certain no of rows we are use flag.

3.For different date flags we are creating flag.

4.For bucket creation we are using flag.

Hope this helps

Thanks & Regards

its_anandrjs

Hi,

Take a look for small example below has a table with 2 fields and SaleFlag is flag field created by any existing field

T:

LOAD * Inline

[

ColA,Sales

A,1000

B,0

C,0

D,3000

];

LOAD

*,

If(Sales = 0,'No Sales','Sales') as SaleFlag

Resident T;

DROP Table T;

Hope this helps

Thanks & Regards