Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

ytd - how can do it ?

hai    

i have 3 feilds: 1 - year 2 - month 3 - sum kg

i want to calculate the ytd for the "sum kg".

i uesed :

 

 

SUM ({<year={'$(vMaxYear)'},month={'<=$(vmaxMonth)'},month=>}{$<_Flag={Inv,InvAdel}>}sum kg

)

 

but it's show me only the current month.

how can i do it?

thanks'

yarin.

SUM({<year={'$(vMaxYear)'},month={'<=$(vmaxMonth)'},year=>}{$<_Flag={Inv,InvAdel}>}sum kg

6 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Try:

SUM ({<year={"$(Max(Year))"},month={"<=$(=Max(Month))"},_Flag={Inv,InvAdel}>}sum kg)

Hope this helps,

Jason

Anonymous
Not applicable
Author

hay

thanks' but now it doesn't show anything.

do you have any idea?

yarin.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Is sum kg in square brackets, [sum kg].

jonathandienst
Partner - Champion III
Partner - Champion III

Yarin

Assuming everything else is correct, I suggest that you try this:

SUM ({<year={"$(=Max(Year))"},month={"<=$(=Max(Month))"},_Flag={'Inv','InvAdel'}>} [sum kg])

(Courtesy Jason, with some minor grammatical fixes)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Jason_Michaelides
Luminary Alumni
Luminary Alumni

D'oh! Thanks Jonathan!

SunilChauhan
Champion II
Champion II

You can try below

SUM ({<year={"$(=Max(Year))"},month=P({<year={"$(=Max(Year))"}>}MOnth},_Flag={'Inv','InvAdel'}>} [sum kg])

hope this helps

Sunil Chauhan