Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Read about Qlik’s Response to COVID-19 Read the Letter, Join the Group.
Highlighted
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
Highlighted
Not applicable

Re: Doubt with set analysis with max(date)

Would it be okay to share your app?

Highlighted
Contributor II

Re: Doubt with set analysis with max(date)


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

Highlighted
Partner
Partner

Re: Doubt with set analysis with max(date)

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.

Highlighted
MVP
MVP

Re: Doubt with set analysis with max(date)

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

Highlighted
Valued Contributor II

Re: Doubt with set analysis with max(date)

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

Highlighted

Re: Doubt with set analysis with max(date)


Hi,

Try like,

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

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
MVP & Luminary
MVP & Luminary

Re: Doubt with set analysis with max(date)

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.