Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
raynac
Partner - Creator II
Partner - Creator II

Select two date fields with one selection?

I am trying to create a system whereby my user chooses a date (or multiple dates) from a single selection box and it chooses two separate (unrelated) dates.

So as an example, we have a service date in tableA and a call date in tableB.  My company owner wants to be able to choose dates in one single place/selector box and get all tableA.service_dates AND all tableB.call_dates that match that one date selection.

I am looking at calendar items, but those look like they still connect to a single date field.

I assume this would have to be somethingin the script but does anyone have an ideas as to how this can be accomplished, or even if it can?

Thank you all in advance for any insight you might have!

1 Solution

Accepted Solutions
Not applicable

I have a document that allows the user to select values from two date fields with one click. In my document, the two date fields are named TDATE and START_DATE. I created a list box but not for a single field, in the Properties of the List Box on the General tab, choose <expression> instead of a field name. Then, in the expression dialog, I typed this:   =TDATE & ' and ' & START_DATE Now, the list box displays a list of all of the pairs of dates that occur in the data. When I click on an entry in the list box the corresponding date values from each of the fields is selected.

View solution in original post

8 Replies
jagannalla
Partner - Specialist III
Partner - Specialist III

TableA:

Load

    *,service_dates as DateField

From TableA;

TableB:

Load

     *,call_dates as DateField

From TableB;

Hope it helps you.

raynac
Partner - Creator II
Partner - Creator II
Author

Thank you!  I gave this a try, but I believe I gave the wrong impression when I said "unrelated" - my apologies.  Both tables are eventually linked back to a client table, so I think what's happening is this is creating a "circular reasoning" situation and it errors out at the end of the load (Execution of Script Failed).

I also tried concatenating all of the dates into a single field, using a three column "bridge" style table(date/call number/service number)...accumulating all the services and all the calls into one table and then trying to use the service numbers and the call numbers to feed back to the applicable place to get the details of each, but I get the exact same error message.

Not applicable

I have a document that allows the user to select values from two date fields with one click. In my document, the two date fields are named TDATE and START_DATE. I created a list box but not for a single field, in the Properties of the List Box on the General tab, choose <expression> instead of a field name. Then, in the expression dialog, I typed this:   =TDATE & ' and ' & START_DATE Now, the list box displays a list of all of the pairs of dates that occur in the data. When I click on an entry in the list box the corresponding date values from each of the fields is selected.

raynac
Partner - Creator II
Partner - Creator II
Author

Thank you, Tim!!  I was unaware that was even possible in Qlikview so you have taught me something that will be userful in other ways, too!

My company owner is very happy 🙂

userid128223
Creator
Creator

I tried and this solution does not work for me. Did it work for you guys.

I am trying to connect 2 dates in straight box via one selector object like year or month.

userid128223
Creator
Creator

hi Raynac

Did the solution work for you.

raynac
Partner - Creator II
Partner - Creator II
Author

Hi there,

I know it's no longer in the view I built, but because it was several months ago, I can't recall why the company president had me change/remove it.  It seems to me that it did work - but for the functionality he needed, this turned out to not really be the right method.  I am sorry I can't be any more specific!

userid128223
Creator
Creator

Hi Tim

The solution is not working for me. I am trying to combine 2 dates search via one field selection. I tried your solution and it does not work.