Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
tresesco
MVP
MVP

PFA,

I have tried for vStartDate, vEndDate

Not applicable
Author

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

israrkhan
Specialist II
Specialist II

Hi Chanel,

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

it might help you

Selecting Arbitrary Date Ranges - YouTube

,

tresesco
MVP
MVP

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

jagan
Luminary Alumni
Luminary Alumni

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.

Not applicable
Author

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

Not applicable
Author

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

jagan
Luminary Alumni
Luminary Alumni

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.