Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SET ANALYSIS - DATE

HI All

i have case where in i need to show the current sales and previous sales in the same table based on the selection user makes i had written an set analysis script as below

Current Sales =SUM({$<DATE={"$(vMaxdate)"}>}Sales)

PreSlaes = SUM({$<DATE *={"$(vPrevDate)"}>}Sales)

this works fine if i select the day but the previous sales values  remains zero  when the selection is on month

kindly suggest

Thanking You

Vinayagam

Labels (1)
7 Replies
anbu1984
Master III
Master III

Try without *

PreSlaes = SUM({$<DATE ={"$(vPrevDate)"}>}Sales)

its_anandrjs
Champion III
Champion III

Try this way

Current Sales =SUM({$<DATE={'$(vMaxdate)'}>}Sales)

PreSlaes = SUM({$<DATE ={'$(vPrevDate)'}>}Sales)

Or

Current Sales =SUM({$<DATE={"$(vMaxdate)"}>}Sales)

PreSlaes = SUM({$<DATE ={"$(vPrevDate)"}>}Sales)

Not applicable
Author

yup Sir even tried the same but still not working in case of the month

its_anandrjs
Champion III
Champion III

What are the expression in the vMaxdate and vPrevDate.

Not applicable
Author

HI SIR


EXPRESSION AS BELOW


vMaxdate=MAX(DATE)

vMaxdate=DATE(AddMonths(Max(DATE),-1))

sureshbaabu
Creator III
Creator III

I guess the issue is beacuse of having multiple years of data. I Believe this will work only when you select an Year from your data.

Thanks

its_anandrjs
Champion III
Champion III

Try with this expressions and put YourMonthFieldHere= in both the expressions.

Current Sales =SUM({$<YourMonthFieldHere=, DATE={"$(vMaxdate)"}>}Sales)

PreSlaes = SUM({$<YourMonthFieldHere=, DATE ={"$(vPrevDate)"}>}Sales)

Eg:-

Current Sales =SUM({$<MonthField=, DATE={"$(vMaxdate)"}>}Sales)

PreSlaes = SUM({$<MonthField=, DATE ={"$(vPrevDate)"}>}Sales)