Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
MuraliPrasath
Creator III
Creator III

Calculated Dimension Query?

Hi QV Team,

I've three fields

1.Designation,

2.Directions

3.Sales.

I just want to have only two columns  1. Designation 2, Sales.

In Designation where Direction field is equal to North. Need help on this?

In Sales column Sum( Distinct ( Sales). 

1 Solution

Accepted Solutions
PrashantSangle

Hi,

2 ways to achieve  it.

1: At front End:

     Create Calculated Dimension

       Calculated Dimension     : If(wildmatch(Directions,'North'),Designation)

     Expression Sum(Sales)

and Suppress Null from dimension Tab

2: At Back End create new field

like

If(wildmatch(Directions,'North'),Designation) as NorthDesignation


and use North Designation field as Dimension.


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 🙂

View solution in original post

6 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this using Set analysis

Dimension: Designation

Expression: Sum({<Direction={'North'}>}Sales)

Hope this helps you.

Regards,

Jagan.

MuraliPrasath
Creator III
Creator III
Author

Hi Jagan,

In Dimension Field I need to restrict Designations where Directions=North. Is this possible?

PrashantSangle

Hi,

2 ways to achieve  it.

1: At front End:

     Create Calculated Dimension

       Calculated Dimension     : If(wildmatch(Directions,'North'),Designation)

     Expression Sum(Sales)

and Suppress Null from dimension Tab

2: At Back End create new field

like

If(wildmatch(Directions,'North'),Designation) as NorthDesignation


and use North Designation field as Dimension.


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 🙂
MuraliPrasath
Creator III
Creator III
Author

Thanks Max & Jagan.

Kushal_Chawda

In script create the Flag as

if(Direction ='North',1,0) as DirectionNorthFlag

Now create the straight table

Dimension:

Designation

Expression:

Sum({<DirectionNorthFlag={'1'}>} distinct Sales)

jagan
Partner - Champion III
Partner - Champion III

It is possible, but it is not suggested to use Calculated Dimensions because of performance issues.  Always try to avoid Calculated dimensions.  I am not sure why you are not using Set Analysis for this purpose?

Regards,

Jagan.