Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
wafsakbp
Contributor II
Contributor II

Only and if(ValueList(

Hello everybody,

I'm trying to combine my measures on one chart , this expression can't give me any results, I don't know why. Please if you have any ideas about this problem share it :

Here is the expression I want to apply to my chart, I found it on this forum :

if(ValueList('Sales','Quota','Expenses')='Sales'

  ,Sum(Sales)

  ,if(ValueList('Sales','Quota','Expenses')='Quota'

     ,Sum(Quota)

     ,Sum(Expenses)

     )

  )

Here is my expression :

if(ValueList('PnL','MTM_taux_bond','Funding_PnL')='PnL'

,only({$<extraction_date= {"$(=date_mois_prec_ouvr)"}>}PnL)

,if(ValueList('PnL','MTM_taux_bond','Funding_PnL')='MTM_taux_bond'

,MTM_taux_bond

,Funding_PnL)

)

By the way these expressions are working alone very well : only({$<extraction_date= {"$(=date_mois_prec_ouvr)"}>}PnL

4 Replies
chrismarlow
Specialist II
Specialist II

Hi,

I don't think what you have posted has any aggregation on the measures within the embedded IF statement (MTM_taux_bond & Funding_PnL) - might that be causing your issue?

Cheers,

Chris.

wafsakbp
Contributor II
Contributor II
Author

@chrismarlow  I already tried but no result, the problem is with the expression "only" :

if(ValueList('PnL','MTM_taux_bond','Funding_PnL')='PnL'

,only({$<extraction_date= {"$(=date_mois_prec_ouvr)"}>}PnL)

,if(ValueList('PnL','MTM_taux_bond','Funding_PnL')='MTM_taux_bond'

,only({$<extraction_date= {"$(=date_mois_prec_ouvr)"}>}MTM_taux_bond)

,only({$<extraction_date= {"$(=date_mois_prec_ouvr)"}>}Funding_PnL))

)

 

Why the expression below is working . When adding sum it also works :

if(ValueList('PnL','MTM_taux_bond','Funding_PnL')='PnL'

,PnL

,if(ValueList('PnL','MTM_taux_bond','Funding_PnL')='MTM_taux_bond'

,MTM_taux_bond

,Funding_PnL)

)

chrismarlow
Specialist II
Specialist II

Hi,

If Only is not returning a value but Sum is that suggests there are multiple different values in MTM_taux_bond and Funding_PnL being added up. Can you supply some (made up) numbers with what you would expect to see?

Cheers,

Chris.

Kushal_Chawda

@wafsakbp  change your set analysis to below

only({$<extraction_date= {"=extraction_date=date_mois_prec_ouvr"}>}PnL)

Do it for others as well