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

Doubt with set analysis with max(date)

Hi

Im using this expression

IF(FLAG = '1', sum ({<MonthYear= {'$(=Max(MonthYear))'} >} FLAG))

I wanna see this graphic only with MAX (MONTHYEAR)

it doesn't work i don't know why

Greetings

7 Replies
Not applicable
Author

Would it be okay to share your app?

saurabh5
Creator II
Creator II


Hi Jeremias,

The Monthyear field is a derived field?, if so you can add date function max(date(monthyear)),See if it works.

Regards

Saurabh

consenit
Partner - Creator II
Partner - Creator II

Hi there.

Does the expression work if you hard-code the desired value, for example:

IF(FLAG = '1', sum ({<MonthYear= {'Jan-2015'} >} FLAG))?


If yes, then clearly it'is a formatting problem, try someting like DATE(MAX(MonthYear), 'MMM-YYYY').


Kind regards,

Ernesto.

maxgro
MVP
MVP

maybe (replace MMM-YYYY with your format)

IF(FLAG='1',

sum({$ <MonthYear={"$(=date(max(MonthYear),'MMM-YYYY'))"}> } FLAG) 

)

not sure if the expression IF(FLAG='1', sum(  ..... FLAG)) makes sense

krishna20
Specialist II
Specialist II

Hi,

Sum(Flag) is not correct approach in my point of view.It will be count or you need to take ant other filed in the place of Flag.

Regards

Krishna

PrashantSangle


Hi,

Try like,

IF(FLAG = '1', sum ({<MonthYear= {'$(=Max(MonthYear))',FLAG={'1'}} >} FLAG))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jagan
Luminary Alumni
Luminary Alumni

Hi,

If you have Monthyear field in this format MMM-YYYY then arrive a date field in your script

Data:

LOAD

*,

Date(Date#(MonthYear, 'MMM-YYYY')) AS Date

FROM DataSource;

Now in chart you can try this expression


Sum ({<FLAG={1}, MonthYear=, Date={'>=$(=MonthStart(Max(Date)))<=$(=Date(Max(Date)))'} >} FLAG)

Regards,

Jagan.