Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date functions in set expression

Hi, I want to have a table which constantly shows recent sales, regardless of current selection. Currently I'm a bit lost at why these two below don't yield same results?

Sum(If(date > '2016-08-08', sales))                         works fine

Sum({$< date = {"> '2016-08-08'"}>} sales)               gives zero as the result

And next question would be how to use functions in set expression. Ideally I'd want to have something like

Sum({1< date = {"> Date(Interval(Today() - 7, 'D'))"}>} sales)               but that gives zero as well.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

How about this:

Sum({<date = {"$(='>' & Date(WeekStart(Today(), -1), 'YYYY-MM-DD'))"}>} sales)

Also read here about Dates in Set Analysis

View solution in original post

7 Replies
Not applicable
Author

Hi MIkko,

I think your date format is not right, Please check your date format with which you are matching as mine is working fine:

Sum({$< date = {"> '2016-08-08'"}>} sales) 

If your question is now answered, Please flag the Correct Answer (via the big "Correct Answer" button near every post).

sunny_talwar

How about this:

Sum({<date = {"$(='>' & Date(WeekStart(Today(), -1), 'YYYY-MM-DD'))"}>} sales)

Also read here about Dates in Set Analysis

Not applicable
Author

Sum({<date = {"$(='>' & Date(WeekStart(Today(), -1), 'YYYY-MM-DD'))"}>} sales)

That worked, thanks Sunny!

Rohit: Thanks for checking that out. I have these in Data load editor

SET TimeFormat='h:mm:ss TT';

SET DateFormat='YYYY-MM-DD';

SET TimestampFormat='YYYY-MM-DD h:mm:ss[.fff] TT';

so I would assume it should compare those dates correctly?

An arbitraty date with

Sum({$< date = {"$(='>' & Date('2016-08-08', YYYY-MM-DD))"}>} sales)

works though, so the problem definitely is somewhere within the date formating.

sunny_talwar

If you got what you wanted, I would request you to close this thread by marking the correct responses and any helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny

Not applicable
Author

Hi Sunny,Capture.PNG

Actually I have only Qlik View Server License not Publisher license, Can I do this activity with this ?

I was looking at Qlik View sample application and there is a chart layout (Object Container )like there are three buttons(Cycle, Drill, Details by Year), Every Button linked with a different chart(Can be line or bar chart). you just need to click on any of the buttons,linked chart will appear on the basis of linking,

Same type of layout works with Variable Extension in Qlik Sense but Problem here is you can link field with the variable button not any chart, Can you please help me , How to create Qlik View Object Container in Qlik Sense

There is one more requirement, I have a field where URLs are coming with every record , When I view that column in Qlik view , I can click on that URL and it will open in default browser, Expression behind that column is

'<url>www.qlikview.com'

Same I want to achieve in Qlik Sense but <URL> key word is not working. Can you help me to know how to display URL in any column ?

Rkota
Contributor III
Contributor III

Many Thanks Sunny T...this post of yours came in handy/helped solve a date related issue.

sunny_talwar

Awesome!! I am glad it did