Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change imagem - Two conditions - Textbox

Hello,

Does Anybody knows how to change imagem with two conditions in text object?

I tried 2 ways, but they don't work.

=if([project] = 'Security Operations' and  [Fase 1] = 'On time', 'qmem://Img_id/green',

if([project] = 'Security Operations' and  [Fase 1] = 'Late', 'qmem://Img_id/red'))

=if(([project] = 'Security Operations' and  [Fase 2] = 'On time'),'qmem://Img_id/green', 'qmem://Img_id/red')

This last way, shows only the last image (red), even I change the "Fase 2" status.

Thank you for your attention.

13 Replies
Anil_Babu_Samineni

You should select project and Fase2 then only Green come due to AND operator. Or you can use OR operator for that.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vvira1316
Specialist II
Specialist II

try this

=if([project] = 'Security Operations', If([Fase 1] = 'On time', 'qmem://Img_id/green', 'qmem://Img_id/red'))

Anonymous
Not applicable
Author

Unfortunately, It didn't work.

Anonymous
Not applicable
Author

Unfortunately, It didn't work.

vvira1316
Specialist II
Specialist II

Would it be possible for you to share sample data and/or app file. You can mask data, refer to Preparing examples for Upload - Reduction and Data Scrambling

Anonymous
Not applicable
Author

Here you go.

Thank you so much

vvira1316
Specialist II
Specialist II

You have following script. Field names are different in script and in your question. Also looking at this data information I'm not seeing data values that will provide 'On time' and  'Late' or even Fase 2 so can you please guide here.

LOAD [Projetos Fase 1],
[Status Fase 1]
FROM
[..\plan db.xlsx]
(
ooxml, embedded labels, table is [Fase1-DOD]);

   

Projetos Fase 1Status Fase 1
Security OperationsEm andamento - Em dia
Rede VirtualizadaEm andamento - Atrasado

Also it would not work in the text as you have set it up.

Not sure if following is what you are expecting

Image1.PNG

=if([Projetos Fase 1] = 'Security Operations',
If([Status Fase 1] = 'Em andamento - Em dia',
'qmem://<bundled>/BuiltIn/check_g.png', 'qmem://<bundled>/BuiltIn/exclamation_r.png'),
'qmem://<bundled>/BuiltIn/check_g.png')

vvira1316
Specialist II
Specialist II

You have data issue..

Please refer to image below.

Image3.PNG

In above case It is not Security Operations and Em andamento - Em dia so it should give you red which it is giving

I reloaded data using your sample data file and I get following.

Image2.PNG

In above case It is Security Operations and Em andamento - Em dia so it should give you green which it is giving

Also your text object will respond if you had a list box to select Status Fase 1 field values as seen in images below

Image4.PNG

Image6.PNG

Here I've used same expression that you had

Anonymous
Not applicable
Author

This way, I need to select field in table to change image and its not work for me.

I need that the image change according is set in spreadsheep (db)  field only.

when project load -- if  the value in the field (db) is one, green else red.

I cannot select field in the table inside project.

😞

Thanks for all