Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Amit_B
Creator II
Creator II

% by Category for each Month

Hi,

I have a master measure that include pick & match:
Pick(Match($(vMeas),1,2,...),
        Num(Count(distinct OrderID),'#,##0'),
        Num(Sum(Sales) / Count(distinct OrderID),'#,##0.0'),
        ...
)

I tried to create a line chart with two dimension (Year-Month and Category) and one measure.
The measure should show the % of each Category out of the total for each Year-Month.
The categories are defined according to certain conditions, the total refers to all the orders.
How can I create it using the master item, while also considering user's selection?
I tried using total ang aggr().

Example for vMeas=1 (should work for all values), lets say there are only 2 categories:

Year-Month Category Master Measure Value Total in Year-Month %
2024-01 a 10 80 12.5%
2024-01 b 40 80 50%
2024-02 a 5 75 6.7%
2024-02 b 25 75 33.3%

 

In the line chart, there will be a line for each category over time. So, for the example, the line of category 'a' will be at 12.5% in 2024-01, 6.7% in 2024-02, and so on.

Thanks.

Labels (5)
3 Replies
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Amit_B 

 

Something like this? (see attached) 

 

You can just add it as a Master Measure.

 

Regards

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

Amit_B
Creator II
Creator II
Author

Thank for the quick response.

I meant that I want to use the master item as is, without edit it.
Something like that:
({<CategoryCode={1,3,5}>}[MasterMeasureName])
\
Sum(Aggr({total}[MasterMeasureName],Year-Month))

The reason for this is to simplify the usage in case the master measure is updated.

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Amit_B 

 

I updated it to use master measures. 

 

Please have a look and revert (See attached)

JandreKillianRIC_0-1736855235585.png

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn