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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
sarfaraz_sheikh
Contributor III
Contributor III

About YTD

Dear All,

I am trying to find the YTD in my application but when i write below expression for YTD ...I am getting nothing in my chart...getting 0 values everytime

Expression is as follows....

=

Sum( {< Date_Num={" >= $(=Num(YearStart(Max(Date_Num)))) <= $(=Today()-1) "} >} SALARY) 

or

=Sum( {< START_DATE={" >= $(=Date(YearStart(Max(START_DATE))),'DD-MM-YYYY') <= $(=Date(Today()-1,'DD-MM-YYYY')) "} >} SALARY)


attached my QVW also for your reference.....

Regards

Sarfaraz

Labels (1)
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

=Sum({<Date_Num={">=$(=Num(Max(YearStart(Date_Num)))) <=$(=Num(Today()))"}>} SALARY)

or

=Sum({<Date_Num={">=$(=Num(YearStart(Max(Date_Num)))) <=$(=Today()-1)"}>} SALARY)

You have embedded spaces into the search expression which is causing a problem. The above two expressions work

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
tresB
Champion III
Champion III

Try like:

=Sum({<Date_Num={">=$(=Num(YearStart(Max(Date_Num)))) <=$(=(Max(Date_Num)))"}  > }   SALARY)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

=Sum({<Date_Num={">=$(=Num(Max(YearStart(Date_Num)))) <=$(=Num(Today()))"}>} SALARY)

or

=Sum({<Date_Num={">=$(=Num(YearStart(Max(Date_Num)))) <=$(=Today()-1)"}>} SALARY)

You have embedded spaces into the search expression which is causing a problem. The above two expressions work

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
djsampat
Creator II
Creator II

Use the following:-

=Sum({<START_DATE={">= $(=Date(YearStart(Max(START_DATE))),'DD-MM-YYYY')<=$(=Date(Today()-1,'DD-MM-YYYY'))"}>}SALARY)

Your syntax was correct, but had spaces before and after a few fields, thus showing 0.

If this helped you, please mark as Helpful. If it solves your issue, please mark as Answer

Regards

Dhruv

alkesh_sharma
Creator III
Creator III

Variables:

vStartdate: =Floor(YearStart(Max(Date_Num))

vToday =Floor((Today)-1)

Expression:

Sum( {< Date_Num={" >= $(=vStartdate) <= $(=vToday "} >} SALARY)

sarfaraz_sheikh
Contributor III
Contributor III
Author

Dear Jonathan/Tresesco

Thanks for your reply !!!! now it is working as expected ...........

Regards

Sarfaraz