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

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
jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attachment.

Regards,

Jagan.

View solution in original post

7 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi Srikanth,

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

Regards,

Jagan.

Anonymous
Not applicable
Author

Hi Jagan,

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

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

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attachment.

Regards,

Jagan.

RedSky001
Partner - Creator III
Partner - Creator III

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

Anonymous
Not applicable
Author

Thanks Jagan and mark

both solutions works

really appricate your help guys

Anonymous
Not applicable
Author

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

RedSky001
Partner - Creator III
Partner - Creator III

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

;