Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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

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

Do u have a date field?

OmarBenSalem

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

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

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

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