Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

srikanthsri1
Valued Contributor

aggrgate below fields

Hi ,

I'm trying to get YTD in reverse order

here are my monthly values

sep - 200    

oct - 210

nov - 300

dec- 400

jan - 100

feb - 200

mar- 230

and expected output should be

sep  - 1540

oct - 1340

nov - 1130

dec- 830

etc

how to write the script logic for thislogic in script () and  not in the front end chart calculation

i also need to do group by with certain filter fields

Any suggestions

1 Solution

Accepted Solutions
MVP
MVP

Re: aggrgate below fields

Hi,

Please find attachment.

Regards,

Jagan.

7 Replies
MVP
MVP

Re: aggrgate below fields

Hi Srikanth,

Post sample data with all the fields.  so that it would be useful to analyse and give solution.

Regards,

Jagan.

srikanthsri1
Valued Contributor

Re: aggrgate below fields

Hi Jagan,

             Thanks for the reply . Please find the attached ....

I need cumulative to be calculated in reverse order .......

MVP
MVP

Re: aggrgate below fields

Hi,

Please find attachment.

Regards,

Jagan.

msheraton
Contributor III

Re: aggrgate below fields

A slight variation on what Jagan came up with.  Depends if you want to group by Product Category or not really.

srikanthsri1
Valued Contributor

Re: aggrgate below fields

Thanks Jagan and mark

both solutions works

really appricate your help guys

srikanthsri1
Valued Contributor

Re: aggrgate below fields

Hey Mark/Jagan,

      I want to group it by one more Dimesion....this is what i'm using ......

if (rowno() =1,Cost,

    if(Previous(Product) <> Product,Cost,if(Previous(subcategory) <> subcategory,Cost,Cost+Peek(rollingCost)))) as rollingtCost

it's not showing the correct value

I want to group to by product and subcategory

Any suggestions

Any suggestion

msheraton
Contributor III

Re: aggrgate below fields

load *

,if(rowno()=1,cost,if(Previous([Product Category]) <> [Product Category] or Previous([Sub Catergory]) <> [Sub Catergory],cost,  Peek(Rollingcost)+cost)) AS Rollingcost

Resident Temp

Order by [Product Category],[Sub Catergory], Date desc

;

Community Browser