Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
varunreddy
Creator III
Creator III

Expression

Hi Guys,

I am trying to achieve commentary, where maximum [commentary date] less than or equal to maximum [As of Date].

i.e. only({<max([commentary date] = {'<= $(vmaxDate)'}>}Commentary).

Can you please correct the expression

17 Replies
sunny_talwar

Can you check if this -> ='<=' & $(vmaxDate) is showing you the right date in the right format?

varunreddy
Creator III
Creator III
Author

Sunny,

Tried This

irstSortedValue({<[commentary date]  = {"{'<=' & $(vMonth)}>} "}>} [Commentary Date], -[commentary date])

Date#(date([Commentary Date],'MM/DD/YYYY')) as [Commentary Date]
Date([As of Date TS],'MM/DD/YYYY hh:mm:ss') as [As of Date TS],
date(floor(timestamp([As of Date TS],'MM/DD/YYYY')))  as [As of Date],

vmaxDate = max({1}[As of Date])

swuehl
MVP
MVP

Try

vmaxDate = Date(max({1}[As of Date]),'MM/DD/YYYY')

sunny_talwar

Try something like this:

=FirstSortedValue({<[commentary date]  = {"$(='<=' & $(vmaxDate))"}>} [commentary date], -[commentary date])

Date([Commentary Date]) as [Commentary Date]
TimeStamp([As of Date TS],'MM/DD/YYYY hh:mm:ss') as [As of Date TS],
Date(Floor[As of Date TS]))  as [As of Date]
,

vmaxDate = Date(Max({1} [As of Date])

varunreddy
Creator III
Creator III
Author

It is giving two values

FirstSortedValue({<[Commentary Date]  = {"<=$(vTest)"},[Commentary Type]= {'Scorecard'}>} [Commentary Date], -[Commentary Date])

vTest - =date(max({1}[As of Date]),'MM/DD/YYYY')

I should get 1/5/2016

sunny_talwar

Do you have commentary date as dimension? You will need to remove that if you do.

varunreddy
Creator III
Creator III
Author

If I take out Commentary Date it is not displaying any output

swuehl
MVP
MVP

Note that vTest is a date in 2016, so why do you only expect 01/05/2015 and not 09/30/2015?