Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IF Statement on to be done on a Selected Field

Hello,

I have a requirement to select a year which comes from the front-end and then execute an IF Statement in a chart.

For example when 2018 is selected go and get a particular value or else select 1.

I cannot for the life of me get this working.

This is my year selection:               SIMULATE.Sim_Year = GetFieldSelections(Calendrier.Année)

This is my IF Statement:                 if(Currency ='Local',SIMULATE.Sim_Rate,1)

I need to get the year of the Sim_Rate or the Year of 1.

I've tried various combinations and I cannot seem to get this to work.

SIMULATE.Sim_Year = '($(=GetFieldSelections(Calendrier.Année))', if( Currency ='Local', SIMULATE.Sim_Rate,1)

Any help would be greatly appreciated.

Paul

13 Replies
pradosh_thakur
Master II
Master II

Can you be more clearer

try this

if( Currency ='Local' and getfieldselections(Calendrier.Année)=2018, SIMULATE.Sim_Rate,1)

Learning never stops.
gavinigovind452
Partner - Contributor II
Partner - Contributor II

try this you are  selecting 1 value in SIMULATE.Sim_Year

if(SIMULATE.Sim_Year = '$(=GetFieldSelections(Calendrier.Année))' and Currency ='Local', SIMULATE.Sim_Rate,1)




Regards,

Govind

shraddha_g
Partner - Master III
Partner - Master III

Where do you want to use IF statement?

In set analysis?

Anonymous
Not applicable
Author

Hi,

Thanks for your answer.

I need to get the value for the SIMULATE.Sim_Rate based on the selected year or else use 1 as the value (this is based on the currency)

Execute this statement

if(Currency ='Local', SIMULATE.Sim_Rate,1) for a year

Anonymous
Not applicable
Author

Thanks for your answer.

I need to get the value for the SIMULATE.Sim_Rate based on the selected year or else use 1 as the value (this is based on the currency)

Execute this statement

if(Currency ='Local', SIMULATE.Sim_Rate,1) for a year

agigliotti
Partner - Champion
Partner - Champion

could you share  a sample app with mock data ?

gavinigovind452
Partner - Contributor II
Partner - Contributor II

please try it

if(SIMULATE.Sim_Year = '$(=GetFieldSelections(Calendrier.Année))' and Currency ='Local'  and getselectedcount(Calendrier.Année)>=1, SIMULATE.Sim_Rate,1)

Anonymous
Not applicable
Author

Here is the app - I had to do it in QV - hope this is ok.

agigliotti
Partner - Champion
Partner - Champion

the field name "Currency" does not exists in data model !?