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: 
Rajesh31
Contributor III
Contributor III

Calculation of Sum based on filter selection

Hi Someone Please help !!

Sample dataset 

CustID Report month 2 wheeler sales 4 wheeler sales cycle sales
1 4 120 40 3000
2 4 30 600 125
3 6 40 14 780
4 6 70 550 800
5 5 80 70 90
6 4 90 45 110

 

Iam trying to build a barchart and based on filter the measure should change , if i select 2 wheeler , i need the measure to be sum(2 wheeler sales), if I select 4 wheeler the filter should be sum(4 wheeler) , on top of this I want a MTD and YTD filter need to be applied ,Kindly guide me with the possible solution 

 

@peterbergman @JordyWegman @MayilVahanan @Mark_Little @David_Friend @vinieme12 

Labels (3)
1 Reply
MayilVahanan

Hi

Change the columns to rows with help of cross table like below

CrossTable(SalesCat, Sales, 2)
LOAD * INLINE [
CustID, Report month, 2 wheeler sales, 4 wheeler sales, cycle sales
1, 4, 120, 40, 3000
2, 4, 30, 600, 125
3, 6, 40, 14, 780
4, 6, 70, 550, 800
5, 5, 80, 70, 90
6, 4, 90, 45, 110
];

For YTD, MTD, refer below link

YTQ, QTD, MTD and WTD - Qlik Community - 1489245

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.