Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shamitshah
Partner - Creator
Partner - Creator

Date expression

Hi,

I have the following variables and want to get the total number of shifts for today:

vToday=Date(today())

vShiftstoday = Count({<Date={"=$(vToday),'DD/MM/YYYY')"}}>}[Shifts.Approved])

I then created a text object in Qlik Sense and entered =vShiftstoday in the expression box but it is showing text

= Count({<Date={"=$(vToday),'DD/MM/YYYY')"}}>}[Shifts.Approved])

instead of a number.

Any idea where it has gone wrong?

Thanks

1 Solution

Accepted Solutions
MK9885
Master II
Master II

count({<Date = {"$(=Date(Today(),'DD/MM/YYYY'))"} >} [Shifts.Approved])

Without variable?

Or create a flag in back-end for today's date if the variable isn't working

if(InDay(YourDateFieldHere,today(),0),1,0) as TodayFlag,

and use

count({<TodayFlag={1} >} [Shifts.Approved])

View solution in original post

5 Replies
devarasu07
Master II
Master II

Hi,

Try like this,

vToday = Date(today(),'YYYY-MM-DD')

vShiftstoday = Num(Count({$<Date={$(vToday)}}>}[Shifts.Approved]),'#,##0')

Thanks,

Deva

its_anandrjs

Try this you have closing bracket but not the opening brackets.

=Count( {< Date ={ "=Date($(vToday),'DD/MM/YYYY')" }>} [Shifts.Approved] )

shamitshah
Partner - Creator
Partner - Creator
Author

Hi Anand,

I tried the above and it gives me the cumulative figure as opposed to just the figure for the day.

Thanks

MK9885
Master II
Master II

count({<Date = {"$(=Date(Today(),'DD/MM/YYYY'))"} >} [Shifts.Approved])

Without variable?

Or create a flag in back-end for today's date if the variable isn't working

if(InDay(YourDateFieldHere,today(),0),1,0) as TodayFlag,

and use

count({<TodayFlag={1} >} [Shifts.Approved])

shamitshah
Partner - Creator
Partner - Creator
Author

Thanks!