Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
rkpatelqlikview
Contributor 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
New Contributor III

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

Try using drill-down group in set analysis.

Mapt - Developer skills delivered

vishsaggi
Esteemed Contributor III

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

rkpatelqlikview
Contributor III

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

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
Contributor

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

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)