Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

senarath
Contributor III

Assign two variables for Date range in Qlik Sense

Hi,

I'm in the process of migrating Apps from Qlik View to Qlik Sense. However most of my apps use selecting a date range by assigning two variables for date Start and date End which is possible in Qlikview. Most of expressions use both current period and corresponding previous period comparisons (current selection period Vs corresponding period)

I'm not yet able to replicate the same in QlikSense apps.

I tried to achieve the same status by using two extensions available in Qlik Branch namely Sense Date Range Picker and Calendar_DatePicker. But I later has a issue where it does not pick any value to the variables defined AND I have no idea as to how to get the corresponding period in Sense Date Range Picker

Would appreciate very much if anybody would advise or recommend a better way to overcome this situation.

Further, hope future releases of Qlik Sense would consider these requirements.

Thanks

Senarath

1 Solution

Accepted Solutions

Re: Assign two variables for Date range in Qlik Sense

For extension Calendar_DatePicker ,called Calendar Variables on Branch, I pasted below line 73 from file Calendar_DatePicker.js


    qlik.currApp(t).variable.setContent(layout.variableTo, valTo);


If you look at the Help for

https://help.qlik.com/en-US/sense-developer/3.0/Subsystems/APIs/Content/MashupAPI/Methods/set-conten...


You will see it says

     This method was deprecated in version 2.1. Use setNumValue or setStringValue instead.

And I am pretty sure this setContent method was completely removed in version 3.0.  Therefore the extension will need sorting to make it work in 3.0+

This serves as a reminder that the extensions on Branch are free open source extensions, but no support is provided for them or any guarantee they will work with new QlikSense versions.



4 Replies

Re: Assign two variables for Date range in Qlik Sense

What version of QlikSense are you using ?

The reason why I ask that is I have a feeling that one, maybe both, of these extensions uses a deprecated API that has since been removed from QlikSense 3.0 onwards.

senarath
Contributor III

Re: Assign two variables for Date range in Qlik Sense

Hi Bill,

I'm using Qlik Sense 3.0.1.

Thanks

Senarath

Re: Assign two variables for Date range in Qlik Sense

For extension Calendar_DatePicker ,called Calendar Variables on Branch, I pasted below line 73 from file Calendar_DatePicker.js


    qlik.currApp(t).variable.setContent(layout.variableTo, valTo);


If you look at the Help for

https://help.qlik.com/en-US/sense-developer/3.0/Subsystems/APIs/Content/MashupAPI/Methods/set-conten...


You will see it says

     This method was deprecated in version 2.1. Use setNumValue or setStringValue instead.

And I am pretty sure this setContent method was completely removed in version 3.0.  Therefore the extension will need sorting to make it work in 3.0+

This serves as a reminder that the extensions on Branch are free open source extensions, but no support is provided for them or any guarantee they will work with new QlikSense versions.



senarath
Contributor III

Re: Assign two variables for Date range in Qlik Sense

Hi Bill,

Noted your worth note and thanks for the support

Rgds,

Senarath

Community Browser