Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would need some help with a set analysis expression.
My source data is:
I have a variable named vFecha = 20150120
Would need an expression that calculates the sum of imp by DES_NEGOCIO (dimension in graph) for records that:
Selected records should be highlighted in yellow:
Thank you very much.
-----------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------
Hola,
necesitaría ayuda con una expresión de set analysis.
Mis datos de origen son:
Tengo una variable llamada vFecha = 20150120
Necesitaria una expresion que calculase la suma de imp por DES_NEGOCIO (dimension en el grafico) para los registros que:
Los registros seleccionados deberían ser los resaltados en amarillo:
Muchas gracias.
hope following code may help you
sum({<FLAG={'A'},PK=P({<FEC_MODIF={"<=$(=vFecha)"}>})>}IMP)
Can you post expected output
Thank you Bhawna Gupta, but I would need the PK with the max(FEC_MODIF <= vFecha)
anbu cheliyan, the output expected would be:
Hi Gaizka,
To achieve this follow the below steps.
1.First get the Max(FEC_MODIF) from the script (this cannot be easily achieved using set analysis)
try like:
Load *;
SQL select PK,
DES_NEGOCIO,
Flag,
max(FEC_MODIFY),
IMP from tablename group by
PK,
DES_NEGOCIO,
Flag,
IMP;
this will give the max modif date.
2. try the expression:
sum({<FLAG={'A'},PK=P({<FEC_MODIF={"<=$(=vFecha)"}>})>}IMP)
Hi Avinash,
the problem is that I cant know wich is the max(Fec_modif) in the script, because the variable vFecha is dinamic.
In the example the value for vFecha was 20150120 but it would be whatever the user select.
Thanks
use this code
sum({<FLAG={'A'},PK=P({<FEC_MODIF={"<=$(=Max(FEC_MODIF))"}>})>}IMP)
it will show you the value for the max date as well as whenever user made any selection it will show the result for that set
Do you want to display PK with the max(FEC_MODIF <= vFecha) along with sum(IMP)?
try like this:
sum({<FLAG={'A'},PK=P({<FEC_MODIF={"=max(FEC_MODIF)"}>}if(FEC_MODIF<=$(vFecha),IMP))
it doesnt work Avinash