# Qlik Sense App Development

Contributor

## How to group dimension based on criteria

Hello gyes,

In a dashboard, I was asked to make a bar chart where to calculate the percentage of clients who visited my our stores at least once a week, monthly, or once every 3 months.

Something like this:

Basically, in terms of data, I have a table with all my clients (ID, Name, Subscribtion_date,...) and a table with all the transaction (TransID, Store, Client_ID, Product, Quantity, Value, Date).

Maybe the title of this question is not correct but I dont know exactly what to ask.

Miguel Cunha

Tags (3)
1 Solution

Accepted Solutions
Honored Contributor III

## Re: How to group dimension based on criteria

In Dimension,

Valuelist('Weekly','Monthly','Every 3 Months')

In Expression,

Pick(Wildmatch(Valuelist('Weekly','Monthly','Every 3 Months'),'Weekly','Monthly','Every 3 Months'),

Expression for Weekly,

Expression for Monthly,

Expression for Every 3 Months

)

In Color by Expression,

Pick(Valuelist('Weekly','Monthly','Every 3 Months'),'Weekly','Monthly','Every 3 Months'),

green(),

yellow(),

red()

)

4 Replies
Honored Contributor III

## Re: How to group dimension based on criteria

Create a Synthetic dimension using Valuelist()

or you can create a inline table in script with these values and use that field as dimension in chart.

For any issues share a sample data so that can help you in better way.

Contributor

## Re: How to group dimension based on criteria

I searched some discussions about Synthetic Dimensions but I dont understand how to aplly it in my case.

Thank you once again!

Honored Contributor III

## Re: How to group dimension based on criteria

In Dimension,

Valuelist('Weekly','Monthly','Every 3 Months')

In Expression,

Pick(Wildmatch(Valuelist('Weekly','Monthly','Every 3 Months'),'Weekly','Monthly','Every 3 Months'),

Expression for Weekly,

Expression for Monthly,

Expression for Every 3 Months

)

In Color by Expression,

Pick(Valuelist('Weekly','Monthly','Every 3 Months'),'Weekly','Monthly','Every 3 Months'),

green(),

yellow(),

red()

)

Contributor