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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
dnowebdn
Contributor
Contributor

target

Hi Team,

Please refer to my source and sample app and provide me the solution.

1 Solution

Accepted Solutions
OmarBenSalem
Partner - Champion II
Partner - Champion II

U know what, Create a date field in ur script:

date( (date(Date#( MonthStart( date#(Month,'MMM')) ,'D/M/YYYY'),'DD/MM')&'/'&Year),'DD/MM/YYYY')  as Date,

Capture.PNG

Now expressions would be SO MUCJ EASIER:

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


Capture.PNG

2) Sum({<Month, Date={"<=$(=max(Date))"}>}Sales)


Capture.PNG

View solution in original post

8 Replies
dnowebdn
Contributor
Contributor
Author

Someone please respond me.

OmarBenSalem
Partner - Champion II
Partner - Champion II

Do u have a date field?

OmarBenSalem
Partner - Champion II
Partner - Champion II

If u do not have a date field :

create a variable :

call it : vMaxMonth

as follow:

=date(max(date(Date#( MonthStart( date#(Month,'MMM')) ,'M/D/YYYY'),'DD/MM')),'DD/MM')

Capture.PNG

1)

Then, change ur measure from:

sum(Sales) to

Sum({<Month={"=date(Date#(MonthStart(date#(Month,'MMM')),'M/D/YYYY'),'DD/MM')='$(vMaxMonth)'"}>}Sales)


Result:

Capture.PNG

OmarBenSalem
Partner - Champion II
Partner - Champion II

and btwn, things will be SO MUCH EASIER if u have a date field

dnowebdn
Contributor
Contributor
Author

Thanks and can you please suggest me on the second chart - line chart to get the data till the values we select i.e if we select feb -- data should be Jan, Feb should appear.

OmarBenSalem
Partner - Champion II
Partner - Champion II

U know what, Create a date field in ur script:

date( (date(Date#( MonthStart( date#(Month,'MMM')) ,'D/M/YYYY'),'DD/MM')&'/'&Year),'DD/MM/YYYY')  as Date,

Capture.PNG

Now expressions would be SO MUCJ EASIER:

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


Capture.PNG

2) Sum({<Month, Date={"<=$(=max(Date))"}>}Sales)


Capture.PNG

dnowebdn
Contributor
Contributor
Author

Thanks but I have month values in capital and may i know where to use that capitalize function

OmarBenSalem
Partner - Champion II
Partner - Champion II

I can't follow u? Didn't I respond to ur quest? What capitalize function?