Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabum
Creator
Creator

Add fields dynamically to the expression

Hello Experts,

I am having one scenario,.

I am using Ad hoc report in Qliksense by using multiple dimensions and multiple expressions.

Base expression is : Sum(sales)/ Sum(Total Sales).

Here if i'm adding region has dimension, Expression should like  - sum(sales)/sum(Total<Region> Sales)

If i included one more dimension , expression should like - sum(sales)/sum(Total<Region,Area>sales)

Means, if i selected any dimension it is going to add or remove from denominator after total qualifier.

Any suggestions ?

Thanks in Advance.

Regards,

Madhu

Labels (2)
5 Replies
Anil_Babu_Samineni

As you said, you are using Adhoc repot. for that, Perhaps this?

If(GetSelectedCount(Dimension)=0, Sum(sales)/ Sum(Total Sales),  Sum(sales)/ Sum(Total <$(=Concat(DISTINCT Dimension, ','))> Sales))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
madhubabum
Creator
Creator
Author

Hi Anil,

Thanks for your reply. But i am getting null values in the expression.

Regards,

Madhu

Anil_Babu_Samineni

Please replace the Dimension field with input field?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
madhubabum
Creator
Creator
Author

Anil - I want to add / remove fields dynamically from selected dimension values.

           With input filed i'm not able to get the expected result.(Measure is not going to calculate - Giving null values).

          is there any solution with Substringcount(Concat())  - ?

 

Thanks in Advance

Anil_Babu_Samineni

Should be possible

=SubStringCount('|' & $(=Concat(distinct Dimension, '|')) & '|', '|Measure1|')

TRy this in Text object and see?

$(=Concat(distinct Dimension, '|'))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)