Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rkpatelqlikview
Creator III
Creator III

How to write a set expression to change the sales of previous date,month, Quarter, Year in Text object

Dear  Experts,

Please let me know how to write a set expression for the sales for last Date, month, Quarter, Year.

If i select the Month then text object should be display the Last month sales and again if select the date of that month it should display the last date sales in one text object..How to write expression for one go.

the below expression working fine but i need the same for Quarter and month and Date. how to inlcude all these in below expression.

Count({<Month=, Year=, Date={">=$(=MonthStart(AddMonths(Max(Date),-1)))<=$(=MonthEnd(Max(Date)))"}>}Types).

Thanks in advance.

Kumar

4 Replies
daniellial
Contributor III
Contributor III

Try using drill-down group in set analysis.

Mapt - Developer skills delivered

vishsaggi
Champion III
Champion III

rkpatelqlikview
Creator III
Creator III
Author

Thanks for your suggestion Vishwa,

I referred those document which are very useful for calculating the YTD,QTD expression.

Here my scenario is i need to show all these expressions in one text object. Here am attaching the file.

Thanks in advance.

captain89
Creator
Creator

Hi,

if i understood correctly you need to have all of these expressions in the same text object.

You can work with chr(13) and & like this:

='Week:'&Count({<Date={">=$(=WeekStart(Max(Date)))<=$(=WeekEnd(Max(Date)))"}>}Sales) &Chr(13)&

'Week:'&sum({<Month=, Year=,Quarter=,Week=, Date={">=$(=WeekStart(Max(Date),-1))<=$(=WeekEnd(Max(Date),-1))"}>}Sales)&Chr(13)&

'Date:'&sum({<Date={"$(=Date(Max(Date)-1))"}>}Sales)