Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
gnaneswarrao
Contributor
Contributor

How to create YTD in Qliksense

How to create YTD in Qliksense

=sum({<Yeear={'>=$(=Yearstart(Max(Yeear))) <=$(Max(Yeear))'}>}Ammount)

is it correct

Labels (1)
3 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi there!

No, this syntax won't fly, for a variety of reasons. If you really want to calculate it on the fly in Set Analysis, then the syntax should be like this:

sum({<Date={">=Yearstart(today())<=Today()"}>}  Amount)

Or like this:

sum({<Date={"=InYearToDate(Date,Today(),0)"}>}  Amount)

However, it would be even better to create a YTD flag in your calendar table and then simply select YTD_Flag={1} in Set Analysis.

If you'd like to learn more about advanced Set Analysis and advanced Qlik development techniques, join us at the Masters Summit for Qlik - coming to New Orleans on November 14-16.

Cheers,

 

sidhiq91
Specialist II
Specialist II

@gnaneswarrao You can use the below set expression to get the desired output.

Sum({<OrderDate={">=$(=Yearstart(Today()))<=$(=today()))"}>}LineSalesAmount)

Please let me know if this resolved your issue, if yes please like and accept it as a solution.

vikasmahajan

Check with this 

https://community.qlik.com/t5/QlikView-App-Dev/Simple-YTD/td-p/1400053

Vikas

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.