Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

anandaqv
New Contributor

Date comparision based on User Entry

I have to compare 2 dates and get the result


User will enter the Date1  : 02/05/2018

   

EntryDate DueDateName
01/05/1802/03/18aaaaa
01/06/1802/06/18bbbb
01/15/1805/20/18cccc
01/30/1806/06/18ddddd
02/02/1808/07/18eeee
02/04/1806/22/18fffff
03/06/1805/02/18dsesd
05/06/1809/09/18mmmm
05/23/1801/04/19rrrrrr
06/22/1804/04/19ttttttt
06/25/1809/09/20ssssss

I have to find which name belongs to this below condition if the user enter the  Date1  : 02/05/2018

   

Entry Date <= Date 1
Due Date >= Date 1

   

what is the best way to handle.I tried with Getfield selection for capturing the user entry and compare the values .It didn't work.

Advance Thanks for your help.

3 Replies
afroz_shaik
New Contributor III

Re: Date comparision based on User Entry

Hi Ananda,

I am not sure of capability that user can enter data.

alternative will be in your script create a table(calendar) that has all the dates. Use a filter in front end give user a capability to enter or search date in there. make sure your Date column name in calendar table matches with your EntryDate.

Then Your KPI expression would be

if(GetCurrentSelections(EntryDate1)>=EntryDate1 and GetCurrentSelections(EntryDate1)<=DueDate1,Name,0)


may be it helps.

xufei123
Valued Contributor

Re: Date comparision based on User Entry

Assume it is Sense, assume Date1 is a variable, press shift + drag your user field to the sheet, then edit the field to:

=if([EntryDate]<='$(Date1)' and [Due Date]>='$(Date1)',

    YourUserField

)

Fei

Re: Date comparision based on User Entry

Enter Means, From Input or Selection in the field?