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: 
Not applicable

Flag

Hi,

Am trying to create flag for DOJ if it exceeds Target date

Then it will load employee count for next month

My script look like this

Load

Emp code,

If(DOJ>Target date, dual(addmonths(DOJ,1),1),0) as flag1

Resident table;

But not working properly

Any help???

9 Replies
Not applicable
Author

Any suggestions please help!!!

ahaahaaha
Partner - Master
Partner - Master

Hi,

Little would fragment the source data, and you want to get in result.

Regards,

Andrey

Anil_Babu_Samineni

May be this

If(DOJ>[Target date],1,0) as flag1

Then use this expression

Count({<flag = {'1'}, Month = {'$(=AddMonths(Max(Month),1))'}>}employee)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

The field flag1 can only have a single text representation* for the value of 1. You presumably have multiple values of DOJ greater than the target - only the last one will survive. I think what you need is:

If(DOJ > [Target date],

     Dual('Yes',1),

     Dual('No', 0)

)as flag1


*the first parameter in Dual()

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

Hi anil,

Your expression looks like correct I applied the same but not giving accurate results....

Pls help

Anil_Babu_Samineni

If possible please share sample to look so that we can look diff ways if we can

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

These are the fields which we have

Load

com-code,

Emp-code,

Requisition no,

Requisition date,

Target date,

DOJ,

No of people required,

If(DOJ>Target date, 1, 0) as flag1

Resident table;

Any suggestions???

Anil_Babu_Samineni

I meant it as Data points to show, Because you've mentioned given expression is working but not giving Accurate values. I am not talking about this. Would you provide sample which demonstrates the Output

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author


Thanks for ur reply......


This is I want to show in straight table.

Dimensions> requisition number, requisition date,    Target date

And expression(which I have explained)

Pls suggest