Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sushil353
Master II
Master II

regarding date range selection

Hi ALL,

I want to give functionality in my dashboard to enter date range manually..

So for that i created two variable vStartDate and vEndDate

in my time dimension table i have field TIME_DATE in 24/07/2011 12:00:00 AM format...

I created two calender object to enter the value with min value as =Min( {1} TIME_DATE) and max value as =Max( {1} TIME_DATE)

and in my chart i applied condition as Sum ({<TIME_DATE={">=$(vStart)<=$(vEnd)"}>} TOTAL_DEFECTS))

But i am not getting results... when i checked the variable value, it is found to be 48750.93333...

Please help me out to find out that wt mistake i did in this...

Thanks...

5 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Its because your Field contains data in DateTime format and your variable is holding data in Date format.

    So according to qlikview they are not same and thus you cant see the filtered data.

    Change the field to DATE from script and create a same field which contains only date.

    Like

    Date(TIME_DATE) as T_DATE

    And use this T_DATE in your set analysis to filterdata.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sushil353
Master II
Master II
Author

Thanks Kaushik,

But i am using TIME_DATE field in other charts where this date time property is used...

how to solve it in another way..

Thanks

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    I am not saying you to remove the field. I said Create a new field which holds only date and use that field in chart in set analysis.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
its_anandrjs

Hi,

Do you share any sample file for this as you say it is not difficult it is looks easy check your date field once again it is correcr or not.

Can you share any sample file.

Regards,

Anand

Not applicable

I think Kaushik Solanki has the more elegant solution, but you could perhaps try adding the date() code to your Set Analysis filter/modifier (to keep from adding a new field via script).  For example:

Sum ({<TIME_DATE={'>=$(=date($(vStart),"MM/DD/YY"))<=$(=date($(vEnd),"MM/DD/YY"))'}>} TOTAL_DEFECTS))

Obviously you can use another date format if needed.