Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rfigueroa
Contributor III
Contributor III

Expression to get the SUM on the First Month...I'm very close

Hi all,

I'm trying to get an expression to obtain the next:  For each InsumoKey (product) the SUM(TotalPago) in the First Month (MesAnio)

I think I'm very close with this expressión:

SUM ( {$<MesAnio = {$(=min(MesAnio))} > } TOTAL <InsumoKey> TotalPago )

But, obviously, $<MesAnio = {$(=min(MesAnio)) is returning the min(MesAnio) for the whole selection, and I need some expression to get the min(MesAnio) for each InsumoKey.

You can see this expression in the example below, in the chart column [Total_FirstMonth], and as you can see, it isn't working for the InsumoKey = "ACH-030" I think because their min(MesAnio) is 201104.

Hope can you help me.

Best regards,

Roberto


9 Replies
Not applicable

I didnt understand very well what you need. Could you post an excel with an example?

rfigueroa
Contributor III
Contributor III
Author

sure,

In the column Total_FirstMonth (F) what I need is the same value from column C which is the SUM(TotalPago) for the first MesAnio for each InsumoKey.

In the QV example that column has the correct value except for the two rows where InsumoKey = "ACH-030"

In the excel example I've yellow colored this two rows.

thank you.

Roberto

Not applicable

Hi Roberto,

Try with this: SUM ( {$<MesAnio = {"=sum(TotalPago)>0"} > } TotalPago )

Hope this helps,

Regards!

rfigueroa
Contributor III
Contributor III
Author

Thank you Gabriela, but I think you didn't understand my problem.

did you see my excel example...?

that's what I want to get.

thank you

Roberto

Not applicable

Hi Roberto,

Here is a solution

Hope this helps

Regards!

rfigueroa
Contributor III
Contributor III
Author

Thank you Gabriela, but it doesn't work if a change order on MesAnio column.

swarup_malli
Specialist
Specialist

Gabriela,

  That was a excellent expression u wrote,

    What is the Above function used for ?

Regards

Swarup

Not applicable

Hi Swarup,

Above(expr) evaluates the expression with the dimension values from the row above the current, you can find more info and examples in the QlikView help

Regards!

swarup_malli
Specialist
Specialist

Thank u , Gabriella

Regards

Swarup