Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

mrbustin
New Contributor II

Stuck - Can't form proper set expression for date range via input box

I cannot figure out the proper syntax to get the proper set of records between a date range using two variables and input boxes.

I created vStartDate and vEndDate variables and capture them via two input boxes and then use date#  to convert to dates but -cannot not get it to work... any helpwould be greatly appreciated. -Mark

count({$<ReceivedDate = {">= date#('$(vStartDate)','MM/DD/YYYY') <= date#('$(vEndtDate)','MM/DD/YYYY') "}>} TrackingNumber)

1 Solution

Accepted Solutions
kenphamvn
Contributor III

Re: Stuck - Can't form proper set expression for date range via input box

Try this

count({$<ReceivedDate = {">=$(= date#($(vStartDate),'MM/DD/YYYY'))

<=$(=date#($(vEndtDate),'MM/DD/YYYY')) "}>} TrackingNumber)

Best regards,

An Pham

2 Replies
kenphamvn
Contributor III

Re: Stuck - Can't form proper set expression for date range via input box

Try this

count({$<ReceivedDate = {">=$(= date#($(vStartDate),'MM/DD/YYYY'))

<=$(=date#($(vEndtDate),'MM/DD/YYYY')) "}>} TrackingNumber)

Best regards,

An Pham

mrbustin
New Contributor II

Re: Stuck - Can't form proper set expression for date range via input box

Thank you An!

I got it to work after making one tweak to your formula, I had to enclose the $expansion of each variable in single quotes:

count({$<FOIAType={'Request'},Status={'Closed'},DateReceived = {">=$(= date#('$(vStartDate)','MM/DD/YYYY'))<=$(=date#('$(vEndDate)','MM/DD/YYYY'))"}>} TrackingNum)

Thanks again An - I was banging my head against the wall

-Mark

Community Browser