Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Hemanth458
Contributor III
Contributor III

Converting month names columns into rows and building associations

I had 2 tables Budget and Sales

where as in budget table having  fields like code, jan,Feb,Mar,...,Dec, etc....

Where as in Sales table having fields like code, Date,Sales,etc....

My requirement is to calculate   MTD,YTD for sales and Invested_Amount based on Year and Month selections.

I had used  Cosstable for Budget  and created master calendar based on date field in Sales table.

but when I select year and month  MTD for sales given accurate results. but for Invested_Amount not given proper results. 

 

2 Replies
PrashantSangle

provide some data with expected output.

Regards
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hemanth458
Contributor III
Contributor III
Author

Sales :

CodeDescriptionDateAmount
1019111Roadways01/01/201910000
1019222Railways01/01/201911000
1019333Airlines05/05/201912000
1019444sea transport06/07/201913000
1019111Roadways05/02/201914000
1019222Railways04/03/201915000
1019444sea transport20/07/201916000

 

Budget:

CodeJanFebMarAprMayJunJulAugSepOctNovDec
10191115000010000050000500005000050000500005000050000500005000050000
10192225000010000050000500005000050000500005000050000500005000050000
10193335000010000050000500005000050000500005000050000500005000050000
10194445000010000050000500005000050000500005000050000500005000050000

 

 

Expected O/P: When selected filters  Year = 2019 , Month = Feb

CodeDescriptionMonth-to-date SalesMonth-to-date Budgetyear-to-date Salesyear-to-date Budget
1019111Roadways1400010000024000150000
1019222Railways010000011000150000
1019333Airlines01000000150000
1019444sea transport01000000150000