Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time period

Hello everyone,

I am looking to create a gauge showing how many actions I have that are due by the end of the month and struggling with the expression. Looking for an expression that would have :

if([Target date]>Today() and [Target date]<Monthend, count(Actions))

Not quite sure how to formulate it.

Thank you

Anna

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

Hi Anna,

You can try this also

Count ( {<[Target date]  = {">$(=Today()) <$(=Monthend(Today()))"} >}  Actions )

Or

Count({<[Target date]  = { '>$(=Today( )) <$(=Monthend)'} >} Actions)

View solution in original post

10 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Count(if([Target date]>Today() and [Target date]<Monthend,Actions,0)


let me know

its_anandrjs
Champion III
Champion III

Try with

Count({<[Target date]  = { '>$(=Today( )), [Target date] = {'<$(=Monthend)'} >} Actions)

Anonymous
Not applicable
Author

Hi Neshina,

Try like this

=Count(if(date([Targetdate],'DD/MM/YYYY')>=Date(Today(),'DD/MM/YYYY') and Date([Targetdate],'DD/MM/YYYY')<=Date(MonthEnd,'DD/MM/YYYY'),Actions))

Anonymous
Not applicable
Author

Alessandro Saccone,

I bet it is just a mistyping, having 0 and ')' on the same key...  And I usually utilize distinct with count:

Count(distinct if([Target date]>Today() and [Target date]<=Monthend, Actions))

alexandros17
Partner - Champion III
Partner - Champion III

The mistake is the missing parenthesis,

Count

     (

          if(

               [Target date]>Today() and [Target date]<Monthend

                    ,Actions

                    ,0

          )

     )


This expression count "Actions" when condition is true otherwise count 0, if you use Distinct and you have the same Action I don't know if it is correct to Discharge

its_anandrjs
Champion III
Champion III

Hi Anna,

You can try this also

Count ( {<[Target date]  = {">$(=Today()) <$(=Monthend(Today()))"} >}  Actions )

Or

Count({<[Target date]  = { '>$(=Today( )) <$(=Monthend)'} >} Actions)

Anonymous
Not applicable
Author

Alessandro,

It is not sum(), it is count()...  The 0-value is a value too, and will be counted.  Just try this in a text box:
=count(0)

alexandros17
Partner - Champion III
Partner - Champion III

You're right ...

Anonymous
Not applicable
Author

So, we agree it was a mistyping