Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
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

Labels (1)
6 Replies
Jason_Michaelides
Partner - Master II
Partner - Master II

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
Partner - Master II
Partner - Master II

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
Partner - Master II
Partner - Master II

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