Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
retko1985
Creator II
Creator II

YTD for bar chart

Hello,

here is a problem I am facing, look at the provided QVW. (Inline Load)

I tried to make an expression, but it is not working. There are two problem.

1) When I select One Month and two years, I want to have 2 Bars - 2016 2 and 2017 2. Now I have bars for each year and each month till selected month.

2) numbers are incorrect, since 2017 2 has to have 40 (20 + 20).

Please help me.

Thank you.

13 Replies
retko1985
Creator II
Creator II
Author

Hello,

Thank you. You are right, March is the 1 month if I sort by Load Order. How come? We load master calendar from database where it is sorted. Any suggestion how this can be fixed? Thank you very much!

sunny_talwar

Are you using QlikView 12 or above? If you are, then try this

Aggr(RangeSum(Above(Sum({<Year, Month>}Sales), 0, RowNo())), Year, (Month, (NUMERIC)))

retko1985
Creator II
Creator II
Author

No, unfortunately 11.

Thank you.

sunny_talwar

Then may be you sort the Month field in the script... Something like this

FactTemp:

LOAD Year,

Month,

Year*100 + Month as YearMonth

Resident Fact

Order By Year, Month;

And then use this expression

Aggr(RangeSum(Above(Sum({<Year, Month>}Sales), 0, RowNo())), Year, YearMonth)