Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Comparison date range selection

Dear community,

Attached herewith a document with little problem in date range selection.

I can't activate the date selection from calendar, it is only working with list box selection (but list box is not desired).

Root cause 1:
Might because the variables (vStartDate,vEndDate,vComparisonStartDate and vComparisonEndDate) are in "num" format type, how do I set the variable in date type?

Actually all variables are getting value from ShortCreatedDate while my ShortCreatedDate is already in date type as shown in script:

Date(floor(ShortCreatedDateTime),'YYYY-MM-DD') as ShortCreatedDate

I am not sure why it still shows "num" format...

Root cause 2:

All the variables are unable to activate the field correctly, I have set up both field event triggers and variable event triggers.

Anyone can help to take a look?

Thanks and best regards,

Chanel

8 Replies
Highlighted
MVP
MVP

Re: Comparison date range selection

PFA,

I have tried for vStartDate, vEndDate

Highlighted
Not applicable

Re: Comparison date range selection

Hi Tresesco,

thanks for fast response! I want to have 2 date selection.

This is the most important part on dashboard.

User can choose 2 date ranges to make comparison in a single chart as shown in chart below:

Thanks,

Chanel

Highlighted
Specialist II
Specialist II

Re: Comparison date range selection

Hi Chanel,

have you seen this video, on selecting From, To Date.

it might help you

Selecting Arbitrary Date Ranges - YouTube

,

Highlighted
MVP
MVP

Re: Comparison date range selection

Have you tried making the similar fixes for variables- vComparisonStatDate and vComparisonEndDate ?

Highlighted
MVP & Luminary
MVP & Luminary

Re: Comparison date range selection

Hi,

Try this expressions

=count( {Analysis}  aggr(If(ShortCreatedDate >=vStartDate AND  ShortCreatedDate <= vEndDate, 1), BrandName, ShortCreatedDate, Post )  )

=count( {Comparator} aggr(If(ShortCreatedDate >=vComparisonStartDate AND  ShortCreatedDate <= vComparisonStartDate, 1), BrandName, ShortCreatedDate ,Post ))

Hope this helps you.

Regards,

Jagan.

Highlighted
Not applicable

Re: Re: Comparison date range selection

Dear tresesco,

Yupe, I edited all variables as shown in attached document.

But it still cannot work well. Kindly advise.

Thanks and best regards,

Chanel

Highlighted
Not applicable

Re: Re: Comparison date range selection

Hi Jagan,

It is working fine in chart for both alternate state, the only problem is selection in calendar cannot activate the corresponding date selection as shown in the attached document.

Thanks,

Chanel

Highlighted
MVP & Luminary
MVP & Luminary

Re: Comparison date range selection

Hi,

Create a new key field by concatenating  

BrandID & ShortCreatedDate & Post in load and use this in set analysis like below

Count({[Analysis] <ShortCreatedDate*={'>=$(=vStartDate)<=$(=vEndDate)'} >} Distinct KeyField)

Hope this helps you.

Regards,

Jagan.