qliksenseqlik-expression

How to filter with set analysis, sum and max, year and day


I'm trying to show the mount from last day loaded in the database (Filtering by year and date).

It will be like this:

Sum({$<ANO_MES={'$(=Max(ANO_MES))'},[SH_historico_1.DIA_PAGO]={19}>}[SH_historico_1.MONTO]/1000000)

The "19" have to be with code automated, and not manually.

So if I put:

[SH_historico_1.DIA_PAGO]={MAX([SH_historico_1.DIA_PAGO])} instead "19"

It will not load. So, how can I filter correctly?

I can show last day loaded "19" but with MAX, like this:

Max({$<[SH_historico_1.ANOMES]={'$(=Max([SH_historico_1.ANOMES]))'}>}[SH_historico_1.DIA_PAGO])

Any ideas? Any help it's welcome, thanks!


Solution

  • Try to put like this so it will evaluate first

    [SH_historico_1.DIA_PAGO]={$(=MAX([SH_historico_1.DIA_PAGO]))}
    

    or for example:

    [SH_historico_1.DIA_PAGO]={"=$(=MAX([SH_historico_1.DIA_PAGO])")}
    

    if it doesn't help you can also create variable with

    MAX([SH_historico_1.DIA_PAGO]
    

    and then put that variable to set analysis