Skip to main content
Announcements
Announcing Qlik Talend® Cloud and Qlik Answers™ to accelerate AI adoption! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
marcorizzo
Contributor III
Contributor III

help with syntax

Hi everybody.

I'm not finding the right syntax.

I've got 2 data fields: data1 and data2.

I've create this pivot table :

Year(data1)Month(data1)code supplier
description supplierGGdata2total
2016gen1abc15/01/2016100 €
2016feb2aaa22/02/2016100 €
2016mar3bbb19/03/2016100 €
2016apr2aaa28/04/2016100 €

I've got difficulties to "write" the column GG.

It should be data2-max(data2 for prevous month).

I'm trying something like this GG = data2 - max{$<Month(data2)={Month(data2)-1} but it doesn't work.

Any help please ?

Many thanks

Marco

3 Replies
avinashelite

could you please explain the what is the max() month for the data 2 with the an example ?? because i am not able to understand your requirement

swuehl
MVP
MVP

This could get complicated when you are having multiple dates per month. If you have only one date per month, as shown in your sample, try chart inter record functions like above():

=data2 - Above(TOTAL data2)

[Chart needs to be sorted by data2 ascending]

So I would suggest that you look into chart inter record functions and see if they might help you.

If not, please post a small sample QVW and your expected result for column GG.

marcorizzo
Contributor III
Contributor III
Author

Sorry Avinanash.

GG = data2 - max{$<mese={Month(data2)-1}data2

in the script I've got this:

data2table:

load Distinct data2,

year(data2) as anno,

Month(data2) as mese,

Week(data2) as settimana,

WeekDay(data2) as descgiorno,

Day(data2) as numgiorno,

QuarterName(data2) as trimestre

resident [Scadenze];