Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ccccchtt
Contributor II
Contributor II

Date pick error using variable input control

Hi all,

I have encountered an issue when picking dates using the variable input:

When I select Jan 2016 under "From", the "To" section shows normal choices (Jan 2016 onwards).

ccccchtt_1-1704871695340.png

But when I changed the "From" filter to other months (for example Feb 2016), the "To" section appears in error, only showing Jan 2024.

ccccchtt_2-1704871757266.png

These two drop down are the Variable input in Qlik Dashboard bundle.

I set the Dynamic value as below: 

='From' & '|' & Concat(distinct {1} PRODUCTION_MONTH & '~' & MonthName(PRODUCTION_MONTH), '|')

= 'To' & '|' & Concat(distinct {1< PRODUCTION_MONTH = {">=$(=NUM(vFromYrMonth))"} >} PRODUCTION_MONTH & '~' & MonthName(PRODUCTION_MONTH), '|')

I have double checked the data source and the month data looks fine. I also found that if I click reload data, the months having above error will change (i.e. Select Jan 2016 will appear a list of Jan 2024, but select Feb 2016 will appear normal).

Any idea why this would happen? All help appreciated.

Thanks a lot

Labels (2)
1 Solution

Accepted Solutions
Rohan
Specialist
Specialist

Ok, Lets do it this way.

Create 2 island Month lists via load script. 

ToCalendar:

Load distinct PRODUCTION_MONTH as TO_Month

Resident Data;

FromCalendar:

Load distinct PRODUCTION_MONTH as From_Month

Resident Data;

& use these two fields in your input variable as follows:

='From' & '|' & Concat(distinct TO_Month & '~' & MonthName(TO_Month), '|')

= 'To' & '|' & Concat(distinct {1< From_Month = {">=$(=NUM(max(TO_Month)))"} >} From_Month & '~' & MonthName(From_Month), '|')

 

You will also have to modify your set expressions accordingly, just check that part.

 

Regards,

Rohan.

View solution in original post

8 Replies
Rohan
Specialist
Specialist

Hi,

Can you share the defination of the variable that you have used : vFromYrMonth ?

 

Regards,

Rohan.

ccccchtt
Contributor II
Contributor II
Author

Hi Rohan,

Both definition and value  of vFromYrMonth are set to "From" 

ccccchtt_0-1704962188013.png

Thanks

Rohan
Specialist
Specialist

Hi,

These values would not be the default ones. I believe these are the variable definitions after you have selected from the drop down. I needed the default definitions that you must have set prior to selections.

 

Regards,

Rohan.

ccccchtt
Contributor II
Contributor II
Author

Hi Rohan,

Sorry but I am not sure how to find the default definition of this vFromYrMonth
I can only find other variables in data load editor

ccccchtt_0-1705024075647.png

Thanks

 

Rohan
Specialist
Specialist

Ok, Lets do it this way.

Create 2 island Month lists via load script. 

ToCalendar:

Load distinct PRODUCTION_MONTH as TO_Month

Resident Data;

FromCalendar:

Load distinct PRODUCTION_MONTH as From_Month

Resident Data;

& use these two fields in your input variable as follows:

='From' & '|' & Concat(distinct TO_Month & '~' & MonthName(TO_Month), '|')

= 'To' & '|' & Concat(distinct {1< From_Month = {">=$(=NUM(max(TO_Month)))"} >} From_Month & '~' & MonthName(From_Month), '|')

 

You will also have to modify your set expressions accordingly, just check that part.

 

Regards,

Rohan.

ccccchtt
Contributor II
Contributor II
Author

I followed your instruction to 

1.  Created ToCalendar & FromCalendar via load script

2.  Updated the dynamic value to 

      ='From' & '|' & Concat(distinct TO_Month & '~' & MonthName(TO_Month), '|')

      = 'To' & '|' & Concat(distinct {1< From_Month = {">=$(=NUM(max(TO_Month)))"} >} From_Month & '~' & MonthName(From_Month), '|')

ccccchtt_1-1705043136121.png

But may I know where I can modify the set expressions and what to modify?

And now it shows Jan 2024 when I chose any month under "From"

ccccchtt_0-1705042834253.png

 

Rohan
Specialist
Specialist

Hi,

just update :

      ='From' & '|' & Concat(distinct From_Month & '~' & MonthName(From_Month), '|')

      = 'To' & '|' & Concat(distinct {1< TO_Month = {">=$(=NUM(max(From_Month)))"} >} TO_Month & '~' & MonthName(TO_Month), '|')

This was a miss at my previous reply. You have kept the new tables unlinked from the rest of your data model, right ?

If you can share a sample of Set expression where you have used those date range variables, i can try to help you with the changes required.

Regards,

Rohan.

ccccchtt
Contributor II
Contributor II
Author

Hi Rohan,

Thanks for the update. I have checked the new tables are unlinked from the rest of the data model.

And the previous set expression using the date range variables is:

=If(GetselectedCount(PRODUCTION_MONTH) > 0, 'Month Range: ' & MonthName(Min(PRODUCTION_MONTH)) & ' - ' & MonthName(Max(PRODUCTION_MONTH)), '')