Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

Expression in set analysis

Hi guys,

Have you ever used an expression as a "field" to be calculated from a set analysis? It would be like this:

=(Avg({$<PeriodField   = {'$(=$(v_Param))'}, FieldA = {'A'}>} (Floor(MonthEnd(MakeDate(Year, Month)))-[DateFieldB])/(36525/100)))

Is there anything I would need to be careful with when using this kind of expressions?

Thanks for your help

Sergio

3 Replies
MVP
MVP

Re: Expression in set analysis

Hi

I see nothing special in that expression - it looks like a normal set expression to me. Perhaps I have misunderstood your question.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Expression in set analysis

Hi Jonathan,

I just wanted to make sure I wasn't doing anything strange. According to your answer, I doesn't look like that.

Thanks so much.

Sergio

oknotsen
Honored Contributor III

Re: Expression in set analysis

Hi,

Not sure what you are trying to achieve, but I noticed you are using the AVG function without the AGGR function.

Example:

If you want to calculate the average Sales per Year, this would be the code:

= AVG(AGGR(Sum(Sales), Year))

If that does not cover your problem, could you please explain more what you are trying to achieve?

May you live in interesting times!
Community Browser