Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jplozano
Contributor
Contributor

Conditional Set Expresion

Hi guys!

I have a problem with one dashboard. I´m calculating the variation between dates with Set Analysis. This variation can be calculated for 3 distinct clients but i want than the variation value only appears when i select ONLY ONE value.

In other graphics i have more information and i can compare the values for all clientes and i cant force to filter just for a value.

My comparison set analysis is this:

(((Sum({$<Fecha_Valor = {"$(=Date(v_max_date))"}>} [Valor Liquidativo]) - Sum({$<Fecha_Valor = {"$(=Date(v_min_date))"}>} [Valor Liquidativo]))*100)/Sum({$<Fecha_Valor = {"$(=Date(v_max_date))"}>} [Valor Liquidativo]))/100

Valor Liquidativo is my measure.

Fecha_Valor is my time dimension.

Cartera is my new dimension to add.

Could you help me please?

Thank you very much!!

Regards

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Maybe this will work for you:

=If( Count(DISTINCT Client)=1 ,

(((Sum({$<Fecha_Valor = {"$(=Date(v_max_date))"}>} [Valor Liquidativo]) - Sum({$<Fecha_Valor = {"$(=Date(v_min_date))"}>} [Valor Liquidativo]))*100)/Sum({$<Fecha_Valor = {"$(=Date(v_max_date))"}>} [Valor Liquidativo]))/100

)

View solution in original post

3 Replies
petter
Partner - Champion III
Partner - Champion III

Maybe this will work for you:

=If( Count(DISTINCT Client)=1 ,

(((Sum({$<Fecha_Valor = {"$(=Date(v_max_date))"}>} [Valor Liquidativo]) - Sum({$<Fecha_Valor = {"$(=Date(v_min_date))"}>} [Valor Liquidativo]))*100)/Sum({$<Fecha_Valor = {"$(=Date(v_max_date))"}>} [Valor Liquidativo]))/100

)

jplozano
Contributor
Contributor
Author

Hi!.

I applied this solution but i use GetSelectedCount from the new field .

Thank you very much!!

petter
Partner - Champion III
Partner - Champion III

Yes GetSelectedCount() is obviously an alternative way of doing it - should actually be slightly faster too.