Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis

Bom dia.

Capturar.JPG

     Tenho uma tabela que mostra um determinado valor referente a mar 2017, porém precisaria que essa coluna pegasse o mes da dimensão e calculasse o valor de 6 meses atrás...e isso se repetisse para os outro, tipo,

Jan 2017 iria calcular = jan2017 -180 dias

Fev 2017 iria calcular = fev2017 -180 dias

E assim por diante...

Tentei fazer usando set analysis, mas não muda nada:

SUM({<C1_CLAS_N4 = {'310101'} , MES_ANO = {"=MONTHNAME(MES_ANO - 180)"}>} VALOR)

Alguém sabe com fazer para eu buscar o valor da dimensão menos um numero de dias e dai sim somar o valor?

5 Replies
Anil_Babu_Samineni

Off course, That should work

Another approach

SUM({<C1_CLAS_N4 = {'310101'} , MES_ANO = {"$(=MONTHNAME(MES_ANO - 180))"}>} VALOR)


Or


SUM({<C1_CLAS_N4 = {'310101'} , MES_ANO = {"$(=AddMonths(MonthName(MES_ANO),-6))"}>} VALOR)



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
Anonymous
Not applicable
Author

I dont know ehy not works...=/

When i put this, the values turn 0...

Miguel_Angel_Baeyens

First, check what format the field MES_ANO has. Assuming it is created using the function MonthName(), then the expression should be

SUM({<C1_CLAS_N4 = {'310101'} , MES_ANO = {"$(=MonthName(AddMonths(MES_ANO, -6))"}>} VALOR)

If MES_ANO does not have the format MMM YY as returned by the function MonthName() you need to use the Date() function instead with the right mask to display as exactly the MES_ANO does.

Anonymous
Not applicable
Author

Actually, i used MonthName(), but i tried any way, bu t not works...=/
I will attach a example...

Anonymous
Not applicable
Author

Hi, attached there are a sample what i need. In second column i need it valeus be a same value reference six month ago...But set analysis don't work...if someone can help me...Thanks