Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sspawar88
Creator II
Creator II

Date Picker in Qlik sense #Qwidget

Hi Community,

I'm working in Qwidget for Date Picker object.

i also created start_date and End_date objects.

BUT there is no association between data and these object whenever i select date range it doesn't effect on dashboards.

where is mistake?

data:

Load

year(txn_time) as "Year",

month(txn_time) as "Month",

WeekDay("txn_time") as DayN,

date(txn_time,'DD-MM-YYYY') as Date,

timestamp(txn_time,'DD-MM-YYYY hh:mm:ss') as "Timestamp",

"txn_time"

FROM [lib://QVD/IOT_TXT_RAW.QVD]

(qvd)

------------------------------------------------------------------------------------------

CalendarTemp:

LOAD

    Max(date(txn_time,'DD-MM-YYYY'))AS DateMax,

    Min(date(txn_time,'DD-MM-YYYY'))AS DateMin

    RESIDENT data;

LET vMaxDate = FieldValue('DateMax', 1);

LET vMinDate = FieldValue('DateMin', 1) -1;

DROP TABLE CalendarTemp;

let vStartDate = Date('$(vMinDate)');

let vEndDate = Date('$(vMaxDate)');

let vYesterday = date(vMaxDate)-1;

6 Replies
ogster1974
Partner - Master II
Partner - Master II

you will need to reference your input variables in your charts measures to effect the dashboard.  Using a bit of set analysis in the expression to set your condition on dates between vStartDate and vEndDate.

sspawar88
Creator II
Creator II
Author

but if i have existing dashboards and at last moment i add date picker in it & i want to change them as per date range selection.

what i have to make changes in logic?

ogster1974
Partner - Master II
Partner - Master II

Without looking at your solution I think you would need to include the date range constraint in your measure expression.  I've not used qWidget date picker before so am unaware of the specifics of how it works (I couldnt find it in Qlik Branch)  but I assume the date picked gets stored in a variable.  you just need to include in your measure expression on the charts that need to use it. 

If you have applied this last minute then you will need to go through all your charts unless you have stored your measures as master items in which case you can modify that and it will update all the charts that use it.

ogster1974
Partner - Master II
Partner - Master II

Look for posts on using set analysis with date ranges to give you a right steer for example of how to modify your measures.

Re: Using date ranges in set analysis

sspawar88
Creator II
Creator II
Author

Hi andy,

Actually i have  a ready application.

how can i add extra such variables in it..if it impact on my existing apps.

i have tried to add those variables in my expression but it impact.

so how can i get a result now for date picker ? 

ogster1974
Partner - Master II
Partner - Master II

In Sense I have used the qsVariable extension to set user defined variables.

qsVariable‌ it doesn't have any input validation on it yet but can be used in simple cases.