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

to provide the user a choice of selecting the number of days (i.e., 5, 10, 20 etc. days)

Hi Everyone,

In my file having a Date Field i.e; "ProcDate", in that having dates of last one month dates.

And i required is i need to have one selection that is where user can choose n-number of dates i.e; if the user chooses 5 in selection then last 5 days dates data should effect in chart, in the same way for 10, 15 upto 30...

Please can anyone tell me how to work on this and which should be used for this either listbox or input selection or anyother ....

Thnks

1 Reply
Not applicable
Author

Hi!

Your solution most likely resides within set-analysis. However, this works only for aggreagation expressions, i.e. sum, count, etc.

In order to do this, first you need to add a part to your script based on your "ProcDate". The script basically creates a date counter:

[code]

Date_counter:

Load distinct

    [ProcDate],

    recno() as DateCounter

resident Time

order by  [ProcDate] asc;

[/code]

After that, your expression would look something like:

=sum( {$<DateCounter = {">=$(#=max(DateCounter)-$(varX))<=$(#=max(DateCounter))"}>} Sales)

where varX is a variable with your input of 5, 10, 15, 20, 25 or 30. Inputbox with restricted list of inputs is preferable to define this variable (inputbox, limitations, predefined values in a list, 5;10;15;20;25;30).

I hope this helps!

BR

Jakob