Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

MVP
MVP

Re: Derived fields not working in Set Analysis

Finally got around to writing that blog post:

Q-Tip #16 – What’s Special About Those Derived Fields | Natural Synergies

enjoy!

Oleg Troyansky

Highlighted
seebach
Contributor III

Re: Derived fields not working in Set Analysis

Ohh, HIC, while your at could you also look at why derived fields are not working in URL parameter selections?

URL Selection on Derived Calendar Fields

roharoha
Valued Contributor III

Re: Derived fields not working in Set Analysis

Hi, is that bug still unsolved?

I found the same problem here accidentally: Set analysis in pivot table

(using Qlik Sense Desktop 3.2 R2)

Neither getselectedcount() nor set analysis work for the derived [YearMonth] fields.

Perhaps the declaration is not correct for that example?

ersanduran
New Contributor III

Re: Derived fields not working in Set Analysis

Hi,

It seems the bug is only partially solved. Derived calendar fields still do not work correctly. If Year from auto calendar is used together with simple equation it works fine, however if a search within Year values is performed it will not work.

For example:

This works: Sum({<Year={2017}>} Sales)

This does not work: Sum({<Year={">2016"}>} Sales)

emmacamacho-hpa
Contributor

Re: Derived fields not working in Set Analysis

Dear Henric,

In the Sept 2017 version this bug is gone, i hope!

Could you please confirm this???

thanks a lot,

nice regards, Emma

Employee
Employee

Re: Derived fields not working in Set Analysis

I just tested it, and I can confirm that the bug is gone in the September release.

The problem that ersan.duran describes is however a different one:

      Sum({<Year={2017}>} Sales)

will compare the textual part of the dual value, whereas

      Sum({<Year={">2016"}>} Sales)

will compare the numerical part of the dual. Normally, there is no difference between the two, but if you have defined your Year using the YearStart() function, which the autocalendar does, it will make a difference.

So, for

      Dual(Year($1), YearStart($1)) AS [Year],

you need to use

      {<Year={">2016-01-01"}>}

but for

      Year($1) AS [Year],

you need to use

      {<Year={">2016"}>}

HIC

plexpro52
Contributor

Re: Derived fields not working in Set Analysis

Hello Henric,

>> I can confirm that the bug is gone in the September release.  The problem that Ersan Duran describes is however a different one...

So, is the instruction you gave -- for Year($1) AS [Year], you need to use {<Year={">2016"}>} -- a workaround for which a fix will be forthcoming, or the optimal way to handle this?

René

Employee
Employee

Re: Derived fields not working in Set Analysis

The behaviour will not change.

The numerical value for YearStart() of 2017-01-01 is 42370, and the greater-than-comparison should of course use this number if the Year field is defined using YearStart().

HIC  

plexpro52
Contributor

Re: Derived fields not working in Set Analysis

Got it, thanks!

ersanduran
New Contributor III

Re: Derived fields not working in Set Analysis

Thanks a lot Henric, I did not pay attention to Dual character of auto calendar.