Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis and expression

Hi there,

Can someone tell me what´s going wrong with this expression? I get an ok in the expresion but is no reporting any data, although both expressions (numerator & denominator) separately give a value.

=count({<"Year([Fecha de Entrada]"={"Year(Today()"}>} [Línea de ped de Compra])/count(DISTINCT(Month([Fecha de Entrada])))

Thanks in advance and regards.

Asier

5 Replies
Not applicable
Author

Try something like,

count(If(Year([Fecha de Entrada])=Year(Today()), [Línea de ped de Compra]/count(DISTINCT(Month([Fecha de Entrada]))))

Hope it helps

jerem1234
Specialist II
Specialist II

You can't have expressions as fields in set analysis like {<year(Date) = {'2014'}>}.

Try this code:

count({<[Fecha de Entrada]={"=Year([Fecha de Entrada])=Year(Today())"}>} [Línea de ped de Compra])/count(DISTINCT Month([Fecha de Entrada]))

Hope this helps!

Not applicable
Author

try this

=count({<Year(date([Fecha de Entrada]))={'$(=Year(Today())'}>} [Línea de ped de Compra])/count(DISTINCT(Month(date([Fecha de Entrada])  )))

Not applicable
Author

Thanks all.

But with the count function at the beguining I get an error message and without it the result is - when the result should return 135.000 / 12.

With the other example I get the same result -

If I calculate both expressions separately I get the result.

Should I define variable for this?

Thanks

Not applicable
Author

Thanks all.

But with the count function at the beguining I get an error message and without it the result is - when the result should return 135.000 / 12.

With the other examples I get the same result -

If I calculate both expressions separately I get the result.

Should I define variable for this?

Thanks