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: 
zahidrahim_ocp
Partner - Creator
Partner - Creator

Total from first day till selected date

Dear Experts,

I want to show the total quantity from the first day the data is available till the date selected in filter pane.

Suppose i have data from 01-JAN-2000 to 13-SEP-2017. Now if i selected date 13-SEP-2017 in a filter then Qlik should show the total records/sum from 01-JAN-2000 till 13-SEP-2017.

Regards,

Zahid Rahim

36 Replies
arulsettu
Master III
Master III

may be this

sum(sales)/sum(Total Sales)

sunny_talwar
MVP
MVP

May be this

Sum({<Date = {"$(='<=' & Date(Max(Date), 'DD-MMM-YYYY'))"}>}Measure)

or this

Sum({<Date = {'<=$(=Max(Date))'}>}Measure)

shraddha_g
Partner - Master III
Partner - Master III

Try

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

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Thank you for all of your replies but i want to show Sum from first date till date selected in a filter (it can be any date selected in the filter) not max date.

sunny_talwar
MVP
MVP

The above expression will change the max(date) based on your selection in date field

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

I have Date in "TRANSACTION_DATE" and Quantity in "PRIMARY_QUANTITY" I have written below in Master Item but none is working:

Sum({<Date = {"$(='<=' & Date(Max(Date), 'DD-MMM-YYYY'))"}>} PRIMARY_QUANTITY)

Sum({<TRANSACTION_DATE = {"$(='<=' & Date(Max(Date), 'DD-MMM-YYYY'))"}>} PRIMARY_QUANTITY)

Sum({<TRANSACTION_DATE ={"<=$(=max(TRANSACTION_DATE))"}>} PRIMARY_QUANTITY)

sunny_talwar
MVP
MVP

How about this

Sum({<TRANSACTION_DATE = {"$(='<=' & Date(Max(TRANSACTION_DATE), 'DD-MMM-YYYY'))"}>} PRIMARY_QUANTITY)

Assuming your transaction_date is in the format DD-MMM-YYYY

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Dear Sunny,

Transaction Date in filter is with below expression:

=date(floor(TRANSACTION_DATE),'DD-M-YYYY')

So i used:

Sum({<TRANSACTION_DATE = {"$(='<=' & Date(Max(TRANSACTION_DATE), 'DD-M-YYYY'))"}>} PRIMARY_QUANTITY)

It is returning 0

Regards,

Zahid Rahim

sunny_talwar
MVP
MVP

This is how it is created in the script?

=date(floor(TRANSACTION_DATE),'DD-M-YYYY')