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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Each Row Each Formula

Hello,

How in QlikView I can put a formula according the selection filter?

I have a filter with many values Each value has to have a formula. See the example for better understanding ...

Thank you!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

If you want to evaluate a different expression per dimension line, you would need a conditional that checks the dimension value and branch into the appropriate expression path, e.g. using a pick/match conditional combination.

See attached a sample.

View solution in original post

4 Replies
swuehl
MVP
MVP

If you want to evaluate a different expression per dimension line, you would need a conditional that checks the dimension value and branch into the appropriate expression path, e.g. using a pick/match conditional combination.

See attached a sample.

pgalvezt
Specialist
Specialist
Author

Hi swuehl ,

Thank you for your reply, Inside from inline table, How could I put a conditional formula from 2 differents resident tables?

See the attached test qvw file...

Valor| Pick( N°Expresion,If(TipoContrato = 'Hora',1.5*Sueldo*Hrs.Ext., If(TipoContrato = 'Día', 1.5*(SueldoMensual/[Horas Pactadas])*Hrs.Ext., 1.5*(Sueldo/30)*(7/45)*Hrs.Ext.))

SueldoMensual = From Different Table...


The other Table contains N°Semanas with another formula...



swuehl
MVP
MVP

The expression must be a valid expression, so I would suggest that you double check by copying the expression to your straight table as expression.

You will see at least two issues

a) a missing closing bracket

b) missing aggregation function

Use Aggregation Functions!

Not sure how you want to aggregate your values, one possible expression could be

Pick( N°Expresion, Sum(If(TipoContrato = 'Hora',1.5*Sueldo*Hrs.Ext., If(TipoContrato = 'Día', 1.5*(SueldoMensual/[Horas Pactadas])*Hrs.Ext., 1.5*(Sueldo/30)*(7/45)*Hrs.Ext.))))

This expression is very costly to calculate, since QV needs to temporarily join all tables on the path between tables where the fields of your aggregation are located.

Then, the logic of the pick( N°Expresion, ...) would expect that you are listing (in your sample) 3 expressions, not only 1.

I assume you started with the first expression, then struggled with the syntax.

Hope this helps,

Stefan

pgalvezt
Specialist
Specialist
Author

Hi,

I found another way to get my result and almost I get it, just one expression gave me bad another result in comparison with the same expression but from the script :

If(TipoContrato = 'Hora',Hrs.Ord.*Sueldo, If(TipoContrato = 'Día', Ds.Trab.*Sueldo, Sueldo/[N° Semanas]))

I put the same expression and script: Watch sueldomensual Table (With Resident table)

I need to get the same value that my expression table graph....

Thanks!