Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Logic Required

i want, when i enter any date from calender, the output shud come greater than selected date

E.g

sum( sales) till sep 26-sep-14

if i enter date 1-sep-14 than the sales would come for the period of 1-sep-14 to 26- sep-14.

KINDLY HELP........

7 Replies
Anonymous
Not applicable
Author

sum({<Mydate={'>=$(=SelectedDate)'}>}sales) gives sum from selected date

JonnyPoole
Former Employee
Former Employee

This would be the basic syntax where vEnteredDate is the variable that captures the inputted date from the calendar object

sum(  {$<Date = {'>=$(vEnteredDate)<=$(=Today())'}>}    Sales)

if you are not using a calendar object you want the 'selected date' you could do calculate the sum only if a user selects one date.

if( getselectedcount(Date) = 1,

     sum(  {$<Date = {'>=$(=Only(Date))<=$(=Today())'}>}    Sales)

)

PrashantSangle

Hi

It is like

Sum({<DateField={">=$(=Date(max(DateField)))"}>}Sales)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

If VEnteredDate is same date as of which I have created MasterCalender...

will it work??

I tried but its not working.....

Say, if any user is selecting MasterCalender or inputbox which is same and he/she selects 1st April 2014..

then I want It should give me till date...

Is it possible??

JonnyPoole
Former Employee
Former Employee


if the variable is VEnteredDate then the expression (slight change for casing of 'v' ) is this


sum(  {$<Date = {'>=$(VEnteredDate)<=$(=Today())'}>}    Sales)


To be honest though i haven't seen your data model and its very common that date types aren't set up correctly. would you be willing to share a QVW sample ? There is no way to guarantee the above expression would work in all data models without reviewing first how the data model is defining dates.

senpradip007
Specialist III
Specialist III

Try like

sum({<DateField={">=$(=Date(max(DateField),'DD-MMM-YYYY'))"}>} sales)

Anonymous
Not applicable
Author

Max,

Your Expression is static, I need a dynamic solution.

Say, If I am selecting a Month(April) and Year(2014) then it should give me:

April-2014

....

....

...

...

Sep-2014 i.e for next 6 month on selection from master calender.

Let me know if you need any other info?