Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
antoniodneto
Creator II
Creator II

Help Expression

Hi Guys,

I have the following field STAGE with their values Stage 1, Stage 2 and Stage 3.

I'm using the expression =SUM({<MACRO={'MESMO ESTAGIO'},DATA_BASE_FINAL={"$(=MAX(DATA_BASE_FINAL))"}>}SDB_ATUAL)/1000000


But I need to create an IF condition with the field MOTIVO.

It would be something like IF STAGE = Stage 1 do SUM({<MACRO={'MESMO ESTAGIO'},MOTIVO={'Continua Stage 1'}DATA_BASE_FINAL={"$(=MAX(DATA_BASE_FINAL))"}>}SDB_ATUAL)/1000000 IF STAGE = Stage 2 SUM({<MACRO={'MESMO ESTAGIO'},MOTIVO={'Continua Stage 2'}DATA_BASE_FINAL={"$(=MAX(DATA_BASE_FINAL))"}>}SDB_ATUAL)/1000000


Depending on field STAGE the expression with the field MOTIVO should change.

Can you help me?

Tks a lot!!!

14 Replies
sunny_talwar

Try this

If(DATA_BASE_FINAL = Max(TOTAL DATA_BASE_FINAL), Sum({<MACRO = {'MESMO ESTAGIO'}, MOTIVO = {'Continua Stage 1'}, MOTIVO_2 = {'Amortiza Saldo'}, DATA_BASE_FINAL={'$(=MAX(DATA_BASE_FINAL))'}>} SDB_ATUAL)/1000000,
If(DATA_BASE_FINAL = Max(TOTAL DATA_BASE_FINAL,2), Sum({<MACRO = {'MESMO ESTAGIO'}, MOTIVO = {'Continua Stage 1'}, MOTIVO_2 = {'Amortiza Saldo'}, DATA_BASE_FINAL={'$(=MAX(DATA_BASE_FINAL))'}>} SDB_ANT)/1000000, 0))
antoniodneto
Creator II
Creator II
Author

Hi still not working,

Only returns 201810 value.

sunny_talwar

How about this

If(DATA_BASE_FINAL = Max(TOTAL DATA_BASE_FINAL), Sum({<MACRO = {'MESMO ESTAGIO'}, MOTIVO = {'Continua Stage 1'}, MOTIVO_2 = {'Amortiza Saldo'}, DATA_BASE_FINAL={'$(=MAX(DATA_BASE_FINAL))'}>} SDB_ATUAL)/1000000,
If(DATA_BASE_FINAL = Max(TOTAL DATA_BASE_FINAL,2), Sum(TOTAL {<MACRO = {'MESMO ESTAGIO'}, MOTIVO = {'Continua Stage 1'}, MOTIVO_2 = {'Amortiza Saldo'}, DATA_BASE_FINAL={'$(=MAX(DATA_BASE_FINAL))'}>} SDB_ANT)/1000000, 0))
antoniodneto
Creator II
Creator II
Author

Now I Got it!!!

Thank you so much for your help!

Could you explain me how it works?

sunny_talwar

Since you had the set analysis on the DATA_BASE_FINAL to show the value for Max DATA_BASE_FINAL... the value was only available for 201810.... but to see the value on 201809, I used TOTAL keyword.